【问题标题】:AVFoundation iOS 5AVFoundation iOS 5
【发布时间】:2011-10-15 18:37:31
【问题描述】:

我在 appstore 上运行的应用使用自 iOS5 更新后无法使用的 mp3 和视频文件

我已经安装了 xcode 4.2 并且... 当我在 iPhone 5 Simulator设备中进行测试时,我收到以下错误(针对音频或视频文件):

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

当我在 iPhone 4.3 模拟器设备中尝试此操作时,它不会崩溃 ..

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

注意:我的应用不使用任何安全措施。

你能帮忙吗?

【问题讨论】:

    标签: iphone video mp3 avfoundation ios5


    【解决方案1】:

    我刚刚找到了答案here

    如果您的应用程序在此处崩溃,请禁用 XCode 4 Breakpoints 选项卡中的所有异常。可能是 SDK 错误。

    【讨论】:

    • 非常感谢。也为我工作。有谁知道为什么会这样?
    【解决方案2】:

    尽量让您的播放器成为保留财产。我遇到了同样的情况,因为我在本地声明了我的播放器,所以我认为只要我声明播放器的方法超出范围,ARC 就会保留。

    使播放器成为保留属性

    @property (strong)AVAudioPlayer *player;
    

    记得设置委托(self.player.delegate = self)并使用委托的方法进行清理:

    -(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)playedSuccessfully {
        self.player = nil;
    }
    

    【讨论】:

    • 是的!谢谢!那是为我做的。
    【解决方案3】:

    我找到了解决方案: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];
    

    【讨论】:

      【解决方案4】:

      我遇到了同样的错误,但我的代码与您的代码没有什么不同。我真的不需要安全框架中的任何东西,但是将该框架添加到我的项目中解决了这个问题。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2017-03-07
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多