2013-06-18 82 views

回答

1

試試這個地方,

- (void)applicationDidEnterBackground:(UIApplication *)application 
{ 
__block UIBackgroundTaskIdentifier task = 0; 
task=[application beginBackgroundTaskWithExpirationHandler:^{ 
    NSLog(@"Expiration handler called %f",[application backgroundTimeRemaining]); 
    [application endBackgroundTask:task]; 
    task=UIBackgroundTaskInvalid; 
}]; 
} 
0

嘗試包括在你的代碼在您開始播放音頻

AVAudioSession *audioSession = [AVAudioSession sharedInstance]; 
[audioSession setCategory:AVAudioSessionCategoryPlayback error:nil]; 
[audioSession setActive:YES error:nil];