• 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: Pax <email@hidden>
  • Date: Tue, 10 Dec 2013 21:07:50 +0000

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.

Given that I do have to initialise it, I'm guessing that it won't be as simple as alloc init, will it, because that will override the existing connections to the button as defined in IB?  What is the secret sauce that I'm missing here?

- Pax

On 10 Dec 2013, at 20:39, Jens Alfke <email@hidden> wrote:

> Check for nil — in the set-the-state code add an assertion that _onOffSwitch!=nil, and in -setActive: add an assertion that sender!=nil. That may help track things down.
>
> (Basically, any time I see a weird bug like “I change a property of ___ but it doesn’t do anything” or “a property of ___ is 0/nil but it shouldn’t be”, I immediately start wondering whether ___ is nil.)
>
> —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: Jens Alfke <email@hidden>
References: 
 >NSButton state not persisting (From: Pax <email@hidden>)
 >Re: NSButton state not persisting (From: Jens Alfke <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