Re: AwakeFromNib called twice for sheet
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