• 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: AwakeFromNib called twice for sheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AwakeFromNib called twice for sheet


  • Subject: Re: AwakeFromNib called twice for sheet
  • From: Jens Alfke <email@hidden>
  • Date: Sat, 12 May 2012 12:48:43 -0700

On May 12, 2012, at 5:01 AM, Koen van der Drift wrote:

> But after the search when the table is displayed, awakeFromNib is called again for the sheet, and all my data is gone.

-awakeFromNib is called for each object in a loaded nib … including the nib 'owner' object. That means it's possible for it to be called multiple times. It looks like what happens in your case is that the first call comes when the window nib is loaded, and the second when the nib containing the view for the table loads (probably because your controller is its owner?)

> I solved it by using windowDidLoad instead of awakeFromNib.

That's the best solution, since the meaning of -windowDidLoad is more specific.

—Jens
_______________________________________________

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: 
 >AwakeFromNib called twice for sheet (From: Koen van der Drift <email@hidden>)

  • Prev by Date: Re: mutableBytes Creates Autoreleased Objects
  • Next by Date: Re: AwakeFromNib called twice for sheet
  • Previous by thread: Re: AwakeFromNib called twice for sheet
  • Next by thread: mutableBytes Creates Autoreleased Objects
  • Index(es):
    • Date
    • Thread