我想在我的iPhone app.I播放音頻文件播放已經使用這個代碼音頻文件不與iPhone的SDK
#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];
但會運行這個程序我得到這個error.Can請人幫忙我解決這個問題。我不明白爲什麼會出現這個錯誤。
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)
謝謝您的回答..
你的代碼沒有問題,看到我的回答如下 – sinh99 2012-08-03 06:50:19