在MPMoviePlayerController中播放视频时出错:找不到符号:___ CFObjCIsCollectable

时间:2012-01-13 14:23:47

标签: ios osx-lion mpmovieplayercontroller

这只发生在Lion上的iOS 5模拟器上。如果我在设备或iPhone 4.3模拟器上试用它,它可以正常工作。

基本上我正在使用远程URL初始化moviePlayer,视频缓冲区以及当我希望它开始播放时,它会因此错误而崩溃:

2012-01-13 08:07:29.169 pluralsight-app[560:1760f] 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
2012-01-13 08:07:29.181 pluralsight-app[560:1760f] 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

我读过这可能是Lion中的一个错误,但希望找到一种解决方法,因为它会影响我的工作效率。

有什么想法吗?

1 个答案:

答案 0 :(得分:3)

我遇到了与AVPlayer相同的问题并最终发现了问题:我为所有异常设置了断点,但AVPlayer在正常工作时会产生异常。因此错误信息&崩溃。

要修复:转到XCode(View | Navigators | Debug Navigator)中的Breakpoint列表并查找“All Exceptions”断点 - 它看起来像这样:Exception Breakpoint

删除它,然后再次尝试代码。

在某些地方报告的这次崩溃的另一个原因是使用ARC并尝试使用本地分配的AVPlayer对象播放声音。显然,使用ARC可以在播放之前清除播放器。

解决方法是通过分配ivar来强烈引用播放器,例如

@property (nonatomic, retain) currentPlayer;


- (void) playSound {
    AVAudioPlayer *player = [[AVAudioPlayer alloc] init];
    self.currentPlayer = player; // Need the strong reference otherwise next line can fail
    [player play];
}