On 05/08/2010, at 11:14 PM, Ken Thomases wrote:

> If you don't need to support subclassing and overriding of this method, just 
> move its body to a function, and have the method be a thin wrapper around the 
> function.


The problem with that is that other parts of the method access private ivars of 
the object, which would need to be made available to the external function - 
the accessors for those would probably eliminate the gains made by avoiding the 
message dispatch for the recursion. The alternative of making the ivars public 
and just using pointer syntax is a way around that, but feels like a hack too 
far (unless there's a way to scope the function so that it can 'see' private 
ivars, but I'm not familiar with how that would be done).

The point about subclassing is well taken, I did this on the basis that it 
wasn't overridable with this in place. That being the case there's probably no 
point in using [self class] instead of the name of the class.

--Graham


_______________________________________________

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

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

Reply via email to