• 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: Is cascading Nib Loading from -awakeFromNib permissible?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Is cascading Nib Loading from -awakeFromNib permissible?


  • Subject: Re: Is cascading Nib Loading from -awakeFromNib permissible?
  • From: Ken Thomases <email@hidden>
  • Date: Wed, 11 Mar 2009 18:03:58 -0500

On Mar 11, 2009, at 5:49 PM, Stuart Malin wrote:

I am getting infinite calls, not double calls.

It sounds to me like you're getting double calls and you're turning them into infinite calls. If you load a nib inside of -awakeFromNib, and you don't guard against being called again, you'll load the nib again, get -awakeFromNib again, load the nib again, ... infinitely.


Further, the second Nib I am loading has no references back to the controller, except as File's Owner.

And that's enough to get awakeFromNib'd.

From the documentation for the awakeFromNib method:

"It is recommended that you maintain a one-to-one correspondence between your File’s Owner objects and their associated nib files. Loading two nib files with the same File’s Owner object causes that object’s awakeFromNib method being called twice, which could cause some data structures to be reinitialized in undesired ways. It is also recommended that you avoid loading other nib files from your awakeFromNib method implementation."

So, you're going against Apple's recommendation in two ways.

Regards,
Ken

_______________________________________________

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: Is cascading Nib Loading from -awakeFromNib permissible?
      • From: Stuart Malin <email@hidden>
References: 
 >Is cascading Nib Loading from -awakeFromNib permissible? (From: Stuart Malin <email@hidden>)
 >Re: Is cascading Nib Loading from -awakeFromNib permissible? (From: Dave Keck <email@hidden>)
 >Re: Is cascading Nib Loading from -awakeFromNib permissible? (From: Stuart Malin <email@hidden>)

  • Prev by Date: Karaoke like algorithm
  • Next by Date: Re: Is cascading Nib Loading from -awakeFromNib permissible?
  • Previous by thread: Re: Is cascading Nib Loading from -awakeFromNib permissible?
  • Next by thread: Re: Is cascading Nib Loading from -awakeFromNib permissible?
  • Index(es):
    • Date
    • Thread