동일한 코드로 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"];
}
동일한 버튼으로 어떻게 다시 시작할 수 있습니까?
가 // 재생에 대한 자세한 내용을 적어주세요 수 있고 // 부분을 일시 중지 하시겠습니까? –
@ 장성진 업데이트 된 답변을 시도하십시오. –
고맙습니다. –