Any idea how can i add my controller class as a observer for my View class' slider?
I am trying to achieve this via Observer way: Inside my controller's viewDidLoad method I am calling
[self addObserver:myView forKeyPath:@"myView.mySlider.value" options:NSKeyValueObservingOptionNew context:NULL];
and in the same controller file i am implementing:
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if ([keyPath isEqualToString:@"myView.mySlider.value"]) {
myView.myImgView.animationDuration = [[change valueForKey:NSKeyValueObservingOptionNew] intValue];
}
}
But my app is crashing. Please help