• 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 issue with NSPanel @"visible" keypath & observeValueForKeyPath
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange issue with NSPanel @"visible" keypath & observeValueForKeyPath


  • Subject: Re: Strange issue with NSPanel @"visible" keypath & observeValueForKeyPath
  • From: vade <email@hidden>
  • Date: Sat, 10 Sep 2011 11:23:49 -0400

Indeed you are correct, I confused the fact that because the binding is available, that KVO would be available on the same key, which is not strictly true or required.

I decided to use binding instead, and while that seemed like it should have worked, it did not on 10.6.8, so I just ended up sub-classing and it met my goal. Thank you.

On Sep 7, 2011, at 10:50 PM, Chris Hanson wrote:

> On Sep 7, 2011, at 5:58 PM, vade wrote:
>
>> I have an NSWindow, which my app controller is observing the value of @"visible" keypath, with the following line
>>
>> 	[previewWindow addObserver:self forKeyPath:@"visible" options:NSKeyValueObservingOptionNew context:NULL];
>>
>
> How did you determine that was a valid key path to observe?  (That is, that the property at the end of the key path - and all intermediate keys - supports KVO?)
>
> In general you can't rely on any arbitrary property, especially of a user interface component like an NSWindow or NSView, supporting KVO.
>
> Instead you should use the notifications the component makes available explicitly for notifying observers of interesting happenings.
>
>  -- Chris
>

_______________________________________________

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

References: 
 >Strange issue with NSPanel @"visible" keypath & observeValueForKeyPath (From: vade <email@hidden>)
 >Re: Strange issue with NSPanel @"visible" keypath & observeValueForKeyPath (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: Lion breaks the ability to "click-through" transparent window areas when the window is resizable.
  • Next by Date: Submitting Mac App to the App Store
  • Previous by thread: Re: Strange issue with NSPanel @"visible" keypath & observeValueForKeyPath
  • Next by thread: JSON Parser
  • Index(es):
    • Date
    • Thread