我有能力聽我的應用程序的MP3歌曲。我使用AVPLAYER 下面是一些代碼avplayer不工作在ios 4.3
player = [[AVPlayer alloc] initWithURL:[NSURL fileURLWithPath:filePath]];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playingItemDidEnd) name:AVPlayerItemDidPlayToEndTimeNotification object:player];
[player play];
timer = [NSTimer scheduledTimerWithTimeInterval:0.5f target:self selector:@selector(checkTime) userInfo:nil repeats:YES];
所以,當我使用的是iOS 5.0我有這個在調試 錯誤加載/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn,262):未找到符號:__ CFObjCIsCollectable 引用自:/ System /Library/Frameworks/Security.framework/Versions/A/Security 預計於:/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFou ndation in /System/Library/Frameworks/Security.framework/Versions/A/Security 2012-02-27 15:21:27.717 LifesMusic [4161:10703] Error loading /System/Library/Extensions/AudioIPCDriver.kext/Contents /Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn:dlopen(/System/Library/Extensions/AudioIPCDriver.kext/Contents/Resources/AudioIPCPlugIn.bundle/Contents/MacOS/AudioIPCPlugIn,262):未找到符號:_ _CFObjCIsCollectable 引用自:/System/Library/Frameworks/Security.framework/Versions/A/Security 預計於:/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation .framework/CoreFoundation in /System/Library/Frameworks/Security.framework/Versions/A/Security
但它仍然有效。但在IOS 4.3中,它根本不工作。有人能幫我解決這個問題嗎?由於
我有avplayer不是avaudioplayer – 2012-02-27 13:50:28
但是AVAudioPlayer被推薦用於音頻......所以你應該按照蘋果推薦 – dom 2012-02-27 13:52:02
確定。謝謝!我會製作avaudioplayer – 2012-02-27 13:53:34