On 11 Mar 2013, at 21:14, Mike Abdullah wrote:

if from an instance  + Method I do:

[super someMethod], then surely it's an error because this isn't an instance?

It *is* an instance. An instance of the *metaclass*. This is where you're deep into the guts of Objective-C :)

Hmmmm, I think I kind of knew this already but the details were fuzzy. Ok, i understand what you mean, so is the following correct:

1. In a Instance - method, if you do [self someMethod] it will call - someMethod in the current class if it is defined there, or it will call -someMethod, in one of the parents of the current instance or error if -someMethod is not defined. If -someMethod is defined, and it calls [self -someMethod] then it will call as high up the chain as possible, e.g. will find -someMethod in one of the subclasses if it is defined or it will call it's own version?

e.g.

BaseClass           <---     Subclass1       <---  Subclass2      <--- Subclass3
-someMethhod    <---------------------------  Subclass2      <--- Subclass3

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to