如何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"];
}
如何通过同一个按钮恢复?