• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSWindowController and designated initializer rules
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSWindowController and designated initializer rules
      • From: Sean McBride <email@hidden>
    • Re: NSWindowController and designated initializer rules
      • From: Graham Cox <email@hidden>
    • Re: NSWindowController and designated initializer rules
      • From: Roland King <email@hidden>
References: 
 >NSWindowController and designated initializer rules (From: Sean McBride <email@hidden>)
 >Re: NSWindowController and designated initializer rules (From: Graham Cox <email@hidden>)

  • Prev by Date: Can't set UINavigationBar tint color?
  • Next by Date: Re: NSWindowController and designated initializer rules
  • Previous by thread: Re: NSWindowController and designated initializer rules
  • Next by thread: Re: NSWindowController and designated initializer rules
  • Index(es):
    • Date
    • Thread