Re: Subclassing Catch-22
Re: Subclassing Catch-22
- Subject: Re: Subclassing Catch-22
- From: Ondra Cada <email@hidden>
- Date: Wed, 27 Apr 2005 01:47:55 +0200
Dan,
On 27.4.2005, at 1:40, Dan Treiman wrote:
In respects to the original question, if you really want to get to an
overridden method you could cast the target as (MySuperClass *), where
MySuperClass is the name of the class whose method is overridden.
This is really a C++ish sort of thing to do tho..
Yup. So much C++ish, that it (luckily!) does not do what you think in a
decent language :)
Namely: sending a message to an object does not depend at all(*) on the
static, compile-time type. Whatever that type is, *always* the proper
thing is done -- all the classes, starting with the object's one, are
searched for an appropriate method.
(*) save for possible argument and return type casts, but that is
completely irrelevant to this debate.
---
Ondra Čada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden