Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread Display Modes
Old May 8, 2011, 09:46 PM   #1
macrumors member
Join Date: Jul 2009
KVO for AVAudioPlayer not working.

Hi, I am trying to observe the "currentTime" property of AVAudioPlayer. But the method isn't even being called... I need it to set the position of a UISlider.. But it's not working. Here's the relevant code:

[audioPlayer addObserver:self forKeyPath:@"currentTime" options:(NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld) context:nil];

- (void)observeValueForKeyPath:(NSString *)keyPath
                        change:(NSDictionary *)change
                       context:(void *)context {
    NSLog(@"%@", change);
Avicenna is offline   0 Reply With Quote
Old May 8, 2011, 10:24 PM   #2
macrumors 65816
Join Date: Dec 2010
Location: Sydney
According to the developer docs for AVAudioPlayer, it does not respond to any of the NSKeyValueObserving messages. Do you know if it's KVO compliant? If it's not, then you can't observe property changes on it.
jiminaus is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
Resolved: YouTube not working on Safari? deannnnn OS X 40 Dec 5, 2013 03:25 PM
Java Applet not working on Lion jake4ever Mac OS X 10.7 Lion 19 Feb 1, 2013 09:44 AM
iPhone 4 ringer not working Causality iPhone Tips, Help and Troubleshooting 3 Oct 20, 2012 01:07 AM
Youtube not working in Safari? Hyde244 Mac Applications and Mac App Store 12 Nov 16, 2011 11:12 PM
Cydia not working day 2! almac04 Jailbreaks and iOS Hacks 18 Jun 12, 2011 01:22 AM

All times are GMT -5. The time now is 12:43 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013,, LLC