I am having a strange problem. I need to stop the player when playback finishes. I am using
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(stopAudio)
name:MPMoviePlayerPlaybackDidFinishNotification
object:nil];
Though the player stops but for the first time stopAudio mehod is called twice, 2nd time it is called 4 times, 3rd time it is called 6 times and so on. I don’t know how to tackle this problem. My stopAudio method is
- (void)stopAudio {
[player pause];
[player stop];
}
I do have a custom button via which also the stopAudio method can be called.
Any suggestions Plz…
Solved the problem…as Zoul suggested I removed the observer inside the stopAudio method. I also replaced the nil object by the player in the NSNotificationCenter. It is working fine now… Thanx Zoul
my stopAudio method is :
}