• 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: NSButton state not persisting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSButton state not persisting
      • From: Uli Kusterer <email@hidden>
References: 
 >NSButton state not persisting (From: Pax <email@hidden>)
 >Re: NSButton state not persisting (From: Jens Alfke <email@hidden>)
 >Re: NSButton state not persisting (From: Pax <email@hidden>)

  • Prev by Date: Re: NSButton state not persisting
  • Next by Date: Re: NSButton state not persisting
  • Previous by thread: Re: NSButton state not persisting
  • Next by thread: Re: NSButton state not persisting
  • Index(es):
    • Date
    • Thread