When playing sound on IPhone using AVAudioPlyer, How to be notified when reaches certain time during the play开发者_如何学Pythoning?
There is delegate method when AVAudioPlayer is finished successfully,
- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag;
If you want to notify user when AVAudioPlayer reaches certain time, you can implement NSTimer using following method.
+ (NSTimer *)scheduledTimerWithTimeInterval:(NSTimeInterval)ti target:(id)aTarget selector:(SEL)aSelector userInfo:(id)userInfo repeats:(BOOL)yesOrNo;
精彩评论