Re: obj-c: how do i call an instance method in my super's super?
Re: obj-c: how do i call an instance method in my super's super?
- Subject: Re: obj-c: how do i call an instance method in my super's super?
- From: Ricky Sharp <email@hidden>
- Date: Wed, 21 Sep 2005 20:50:26 -0500
On Sep 21, 2005, at 8:00 PM, Ian Anderson wrote:
Maybe I'm missing something here, but if subClassOfBaseClass
doesn't implement foobar, then when you say [super foobar] in -
[subClassOfSubClassOfBaseClass foobar], it will go up the chain to
baseClass's implementation of foobar. Yes
That's my take on this as well. The only language I've used which
didn't allow for this was Symantec's C+ (yes, just one '+'). It was
C, but with a few extensions which gave you keywords like
"inherited". So if you had classes A, B and C (with A being the
root), C's implementation of an overridden method could only ever
call up to B's implementation. Basically, you could only call up one
level; the limits of using "inherited".
given class structure:
baseClass
subClassOfBaseClass
subClassOfSubClassOfBaseClass
and each of these classes has an instance method foobar. how can i
call baseClass's foobar from within
subClassOfSubClassOfBaseClass's foobar?
for the time being, i've put a "proxy" method in
subClassOfBaseClass that simpl;y calls baseClass's foobar and i
call this "proxy" method from foobar in
subClassOfSubClassOfBaseClass. but it seems that there aught to be
a more direct approach (without having to talk directly to the
runtime code).
thanx,
ken
___________________________________________________________
Ricky A. Sharp mailto:email@hidden
Instant Interactive(tm) http://www.instantinteractive.com
_______________________________________________
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