• 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: Strange observer problem (solved)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange observer problem (solved)


  • Subject: Re: Strange observer problem (solved)
  • From: Gordon Apple <email@hidden>
  • Date: Sat, 01 Dec 2012 15:09:33 -0600
  • Thread-topic: Strange observer problem (solved)

Apparently, you are right.  You¹re not going to believe the solution I came
up with.  I added another button to the view with the same binding, linked
the view to it instead of the original one, then hid the new button.  Now,
everything works correctly. If you can¹t skin a cat one way...


On 12/1/12 2:01 PM, "Ken Thomases" <email@hidden> wrote:

> On Dec 1, 2012, at 12:48 PM, Gordon Apple wrote:
>
>> > On 12/1/12 10:29 AM, "Kyle Sluder" <email@hidden> wrote:
>> >
>>> >> Sounds like NSButton is not KVO-compliant for `state`.
>> >
>> > Well, its bindings certainly work, and the observers works when its state
>> is
>> > changed by the distant (also bound) button.
>
> Nothing about NSButton's bindings workings imply that its "state" property is
> KVO-compliant.
>
> If something calls -setState: on the button (including KVC, while carrying out
> -setValue:forKey:), then that will generate KVO change notifications.  That's
> because -setState: conforms to the accessor naming conventions, so KVO can
> hook it.  However, when the button changes its own state in response to mouse
> events, it may not go through -setState: or otherwise be KVO-compliant.  It
> could just set an instance variable.  That's invisible to KVO.
>
> Regards,
> Ken
>


_______________________________________________

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: Strange observer problem (solved)
      • From: Kyle Sluder <email@hidden>
References: 
 >Re: Strange observer problem (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: FileWrapper & iCloud
  • Next by Date: Re: Strange observer problem (solved)
  • Previous by thread: Re: Strange observer problem
  • Next by thread: Re: Strange observer problem (solved)
  • Index(es):
    • Date
    • Thread