• 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: Designated Initializer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Designated Initializer


  • Subject: Re: Designated Initializer
  • From: Julien Jalon <email@hidden>
  • Date: Sat, 30 Oct 2010 22:41:17 +0200

NSWindowController doc states that you should invoke super's initWithWindow:
or initWithWindowNibName:

"In your class’s initialization method, be sure to invoke on super either
one of the initWithWindowNibName:... initializers or the initWithWindow:
initializer"

This breaks the designated initializer pattern, which is bad (and indeed
initWithWindowNibName: calls [self initWithWindow:]). Not catastrophic
though if you look at the usual usage pattern for NSWindowController.

--
Julien

On Sat, Oct 30, 2010 at 10:32 PM, Richard Somers <email@hidden
> wrote:

> Thanks for the insight.
>
> If calling any of super's initializers will work from the designated
> initializer, why then does Apple specifically say the designated initializer
> "should begin by sending a message to super to invoke the designated
> initializer of its superclass"?
>
> There must be a subtle issue here.
>
> --Richard Somers
>
>
> On Oct 30, 2010, at 1:12 PM, Dave Carrigan wrote:
>
>  So just because a designated initializer didn't call super's designated
>> initializer, it doesn't mean that super's designated initialer was not
>> invoked; it was.
>>
>
> _______________________________________________
>
> 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
>
_______________________________________________

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

References: 
 >Designated Initializer (From: Richard Somers <email@hidden>)
 >Re: Designated Initializer (From: Dave Carrigan <email@hidden>)
 >Re: Designated Initializer (From: Richard Somers <email@hidden>)

  • Prev by Date: Re: Designated Initializer
  • Next by Date: Re: Designated Initializer
  • Previous by thread: Re: Designated Initializer
  • Next by thread: Content types processable by an application
  • Index(es):
    • Date
    • Thread