KVO on NSSlider not observing
KVO on NSSlider not observing
- Subject: KVO on NSSlider not observing
- From: Aaron Wallis <email@hidden>
- Date: Fri, 12 Dec 2008 23:36:06 +1100
Hi there,
I'm having issues setting up bindings via code (rather than in IB)
I've got a NSObject subclass which is being used as the controller,
and a NSView subclass which has a few controls like NSSliders.
In the NSObject I have the following code:
- (void)setupSliders {
[controlsView.tempSlider addObserver:self forKeyPath:@"value"
options:NSKeyValueObservingOptionNew context:NULL];
}
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object
change:(NSDictionary *)change context:(void *)context {
NSLog(@"It's Changed!!");
[super observeValueForKeyPath:keyPath ofObject:object
change:change context:context];
}
When I build and run the controls are rendered as expected however
when I interact I don't get the "It's changed" message.
Any ideas where I could be going wrong?
Cheers
- Az
_______________________________________________
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