iPhone OS 4.0의 멀티 태스킹 기능을 사용하려고합니다. 나는 운이없는 백그라운드에서 오디오를 재생하려고했습니다. info.plist에 UIBackgroundModes 속성을 추가하고 백그라운드에서 재생하려면 오디오가 필요합니다. 또한 오디오를 재생하기위한 코드도 추가했습니다. `iPhone OS 4 멀티 태스킹 - 오디오 재생 백그라운드에서
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"someday" ofType:@"mp3"]];
AVAudioPlayer *audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
[audioPlayer play];
`. 앱에서 버튼을 클릭하면 오디오가 재생되기 시작합니다. 하지만 앱을 종료하면 멈 춥니 다. 백그라운드에서 재생하려면 어떻게해야합니까?
감사합니다, 토니
iOS4를 다루는 NDA가 해제 될 때까지 사람들이이 질문에 답하고 싶지 않을 수도 있습니다 ... –
그래, 공식 포럼에 가져 가라. –
중복 질문 : http://stackoverflow.com/questions/3161635/entering-background-on-ios4-to-play-audio –