AVFoundation iOS 5

发布于 2024-12-10 12:40:21 字数 1013 浏览 0 评论 0原文

我在应用商店中运行的应用使用自 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

当我在 iPhone 4.3 模拟器<中尝试此操作时/strong> 或设备它不会崩溃 ..

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

注意:我的应用程序不使用任何安全性。

你能帮忙吗?

My apps runing on the appstore are using mp3 and video files that don't work since iOS5 update.

I've installed xcode 4.2 and...
When I test in the iPhone 5 Simulator or device I get the following error (for audio or video files):

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

When I try this in the iPhone 4.3 simulator or device it does not crash ..

I've cleaned and re import the frameworks involved but it seems to be that kind of error

Note: My apps don't use any security.

Could you help?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

枯叶蝶 2024-12-17 12:40:22

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

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

I just have found an answer here.

If your app crashes here, disable All Exceptions in XCode 4 Breakpoints Tab. Maybe it's SDK bug.

清旖 2024-12-17 12:40:22

尝试让你的球员成为保留财产。我经历了同样的事情,因为我在本地声明了我的播放器,所以我认为一旦我声明播放器的方法超出范围,ARC 就会保留。

让玩家成为保留属性

@property (strong)AVAudioPlayer *player;

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

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

Try to make your player a retained property. I experienced the same and because I declared my player locally I think ARC retained as soon as the method in which I declared the player ran out of scope.

Make player a retained property

@property (strong)AVAudioPlayer *player;

Remember to set the delegate (self.player.delegate = self) and use the delegate's methods to clean up:

-(void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)playedSuccessfully {
    self.player = nil;
}
谢绝鈎搭 2024-12-17 12:40:22

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

I found the solution: NSURL instead of 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];
丑疤怪 2024-12-17 12:40:22

我有同样的错误,但我的代码与你的没有不同。我实际上并不需要安全框架中的任何内容,但将该框架添加到我的项目中解决了这个问题。

I had the same error, but my code wasn't different from yours. I don't really need anything in the Security framework, but adding that framework to my project fixed this issue.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文