1
如何使用同一段代码制作play/Pause
按钮。使用相同的按钮播放/暂停
- (IBAction)min:(id)sender
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"1min" ofType:@"mp3"];
AVAudioPlayer *theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
theAudio.numberOfLoops = -1;
[theAudio play];
[[NSUserDefaults standardUserDefaults] setObject:@"-" forKey:@"music"];
}
我该如何恢复相同的按钮?
能请写//播放更多的细节和//暂停部分? –
@JangSejin试试我的更新回答.. –
非常感谢你 –