它通过实现此代码为我工作.无论出于何种原因,这在模拟器中都不起作用.因此,如果您的代码相同或类似,请相信它在安装了iOS4的iPod touch上运行得非常出色.
App Delegate.m (either in init or applicationDIDFinishLaunching)
- (ID) init { // allows you to play in the background when app is suspended in iOS4 [[AVAudioSession sharedInstance] setDelegate: self]; [[AVAudioSession sharedInstance] setcategory: AVAudioSessioncategoryPlayback error:nil];}
当然,请确保将uibackgroundmodes键设置为音频,如前所述.
祝你好运,
抢
总结以上是内存溢出为你收集整理的iOS4 – 使用iPhone模拟器的背景音频全部内容,希望文章能够帮你解决iOS4 – 使用iPhone模拟器的背景音频所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)