On 12/02/2010, at 1:43 PM, Gordon Apple wrote:

> My point was that if all Cocoa classes called "init"
> somewhere in their other initializers (or had a two-step initialization
> similar to what MacApp did), then you could simply override (not call)
> "init" for simple ivar initialization in a subclass, which would in no way
> interfere with a designated initializer.


Except that it would be all too easy to create an infinite loop. A subclass 
might implement -init to call super's designated initializer, which later calls 
-init.

I'm not sure what's complex about overriding the designated initializer - even 
if it has a complex set of parameters, (and most do not) then all you do is 
pass them up to super. Your suggestion would only save a tiny, tiny amount of 
work yet lead to potentially big problems.

--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