Re: What classes have -init?
Re: What classes have -init?
- Subject: Re: What classes have -init?
- From: Graham Cox <email@hidden>
- Date: Fri, 12 Feb 2010 15:28:30 +1100
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 (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