On Dec 10, 2013, at 1:07 PM, Pax <45rpmli...@googlemail.com> 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to