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

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

Reply via email to