Re: NSButton state not persisting
Re: NSButton state not persisting
- Subject: Re: NSButton state not persisting
- From: Jens Alfke <email@hidden>
- Date: Tue, 10 Dec 2013 13:26:50 -0800
On Dec 10, 2013, at 1:07 PM, Pax <email@hidden> wrote:
> Ah! Exactly right. It is nil - but surely I shouldn't have to initialise it? I never have in the past - I built the UI with IB, and I was under the impression that that would handle all the initialisation for me.
The code must be running before the nib’s been loaded. Set a breakpoint and look at the backtrace for clues.
You mentioned awakeFromNib being called twice — the situation I’ve seen this happen is when an object is _contained_ in one nib, and also the _owner_ of another (that it loads). For instance if your app delegate has a method that loads a nib with itself as the owner, then -awakeFromNib will be called once when the app initializes and MainMenu.nib is loaded, and then again when you load your own nib. Different outlets are going to be hooked up at those times.
—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