我正在尝试在我的 iphone 应用程序中播放音频文件。我已经使用了这个代码
#import <AVFoundation/AVFoundation.h>
NSBundle *bundle = [NSBundle mainBundle];
NSString *musicPath = [bundle pathForResource:@"audioSample" ofType:@"mp3"];
NSURL *musicURL = [NSURL fileURLWithPath:musicPath];
NSError *error= [NSError errorWithDomain:@"Domain" code:0 userInfo:nil];
AVAudioPlayer *aplayer= [[AVAudioPlayer alloc] initWithContentsOfURL:musicURL error:&error];
aplayer.delegate = self;
[aplayer play];
但是运行这个应用程序我会收到这个错误。任何人都可以帮我解决这个问题。我不明白为什么会发生这个错误。
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: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-08-03 10:12:07.330 SampleAudioCode[591:12003] Error loading /Library/Audio/Plug-Ins/HAL/Digidesign CoreAudio.plugin/Contents/MacOS/Digidesign CoreAudio: dlopen(/Library/Audio/Plug-Ins/HAL/Digidesign CoreAudio.plugin/Contents/MacOS/Digidesign CoreAudio, 262): Symbol not found: ___CFObjCIsCollectable
Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
Expected in: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
in /System/Library/Frameworks/Security.framework/Versions/A/Security
2012-08-03 10:12:07.330 SampleAudioCode[591:12003] Cannot find function pointer NewDigiCoreAudioPlugIn for factory B8A063B5-2F3D-444A-88CB-D0B8F1B22042 in CFBundle/CFPlugIn 0xdc50f50 </Library/Audio/Plug-Ins/HAL/Digidesign CoreAudio.plugin> (bundle, not loaded)
谢谢您的回答..