5
我想观察AVAudioPlayer的“currentTime”属性。但该方法甚至没有被称为...我需要它来设置一个UISlider的位置..但是它不起作用。以下是相关代码:KVO AVAudioPlayer不工作
[audioPlayer addObserver:self forKeyPath:@"currentTime" options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld) context:nil];
- (void)observeValueForKeyPath:(NSString *)keyPath
ofObject:(id)object
change:(NSDictionary *)change
context:(void *)context {
NSLog(@"%@", change);
}
谢谢。