Another Gnarly Objective-C Question!
Another Gnarly Objective-C Question!
- Subject: Another Gnarly Objective-C Question!
- From: Dave <email@hidden>
- Date: Tue, 12 Mar 2013 08:39:54 +0000
Hi All,
Thanks for all help on the last question, here is one on a similar vein:
This is all Class methods, no instances are allocated or intended to
be allocated at this stage.
in + Method in a subclass:
[[self class] someMethod];
This calls +someMethod in the current class, if it exists, if not, it
calls in one of the super-classes if it exists. Is this correct?
If one of the super classes calls [[self class] someMethod]; It will
call as high up the chain as possible, resulting in an infinite loop
in this case?
Is there a diagram somewhere showing how this works for the 4 cases of:
1. [[self class] +someMethod];
2. [[super class] +someMethod];
3. [super +someMethod];
4. [[self superclass] +someMethod];
It does seem logical to expect that if:
[[self class] someMethod]; calls +someMethod the [[super class]
+someMethod] would call +someMethod in the Superclass or is it just
me??? lol
Thanks a lot
Dave
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden