AVFoundation iOS 5

E-G*_*tar 15 iphone video mp3 avfoundation ios5

我在appstore上运行的应用程序正在使用自iOS5更新后无效的mp3和视频文件.

我安装了xcode 4.2和...当我在iPhone 5模拟器设备上测试时,我收到以下错误(对于音频或视频文件):

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): 
Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
Run Code Online (Sandbox Code Playgroud)

当我在iPhone 4.3模拟器设备中尝试这个时它不会崩溃 ..

我已经清理并重新导入所涉及的框架,但似乎是那种错误

注意:我的应用不使用任何安全性.

你能帮忙吗?

sas*_*nec 9

我刚刚在这里找到了答案.

如果您的应用程序崩溃,请禁用XCode 4 Breakpoints选项卡中的All Exceptions.也许这是SDK的bug.


E-G*_*tar 1

我找到了解决方案:NSURL而不是NSString

NSURL *chemin = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/MySound.wav", [[NSBundle mainBundle] resourcePath]]];
NSError *error;
AVAudioPlayer* mySound = [[AVAudioPlayer alloc] initWithContentsOfURL:chemin error:&error];
mySound.delegate = self;
[chemin release];
[mySound Play];
Run Code Online (Sandbox Code Playgroud)