Re: NSWindowController and designated initializer rules
Re: NSWindowController and designated initializer rules
- Subject: Re: NSWindowController and designated initializer rules
- From: Quincey Morris <email@hidden>
- Date: Mon, 23 Jun 2014 18:14:05 -0700
On Jun 23, 2014, at 17:30 , Graham Cox <email@hidden> wrote:
> I interpret that to mean it must call a designated initializer *eventually*, not necessarily directly. Since all -initXXX methods of the superclass must call the superclass's designated initializer, your subclass's D.I. can call any of the superclass's -initXXX methods.
Actually, I understood the thrust of Sean’s question as being that NSWindowController’s initializers don’t follow Swift rules.
If you look in the Swift book, you’ll see that convenience constructions may only call “across” (that is, call an initializer in the same class), while designated constructors may only call “up” (to a *designated* initializer in the superclass).
In that regard, ‘initWithWindowNibName:’ must be a designated initializer, since subclasses that don’t do their own nib loading have nothing else to call “up” to.
I assume, therefore, that ‘initWithWindowNibName:’ is marked as a designated initializer in 10.10, though I haven’t looked to check this.
_______________________________________________
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