iOS:游戏中心在模拟器上崩溃

时间:2022-09-06 21:16:14

This is driving me crazy, I just can't find out the problem:
I have a crash on game center on simulator, in the device it works perfect. It crashes when I call the following code:

这让我发疯,我只是找不到问题:我在模拟器上的游戏中心崩溃,在设备上它的工作完美。当我调用以下代码时崩溃:

[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) {
    if (error) { 
        NSLog(@"An error occured authenticating the local game center player");
        NSLog(@"Error: %@", [error localizedDescription]);      
    }
}];

I've tried setting both deployment target and base sdk to 4.3 with no luck.
I've tried doing the call from application:didFinishLaunchingWithOptions: and also doing it later after the player clicks on the "play" button in the main screen. Both cases the same result.

我已经尝试将部署目标和基本sdk设置为4.3而没有运气。我已尝试从应用程序执行调用:didFinishLaunchingWithOptions:并在玩家点击主屏幕中的“播放”按钮后再执行此操作。两种情况都有相同的结果。

Also, I get no stack trace; it looks like this:

而且,我没有堆栈跟踪;它看起来像这样:

0 objc_msgSend
1 < ???? >

I get a EXC_BAD_ACCESS.

我得到一个EXC_BAD_ACCESS。

Any idea will be appreciated.
Thanks

任何想法将不胜感激。谢谢

1 个解决方案

#1


7  

The problem was that in 'Other Linker Flags' option in xcode I had -weak_library /usr/lib/libSystem.B.dylib changing this to -weak-lSystem fixes the problem

问题是在xcode的'Other Linker Flags'选项中我有-weak_library /usr/lib/libSystem.B.dylib将此更改为-weak-lSystem修复了问题

I found other person with the same problem in a comment in this question: iOS 4 app crashes at startup on iOS 3.1.3: Symbol not found: __NSConcreteStackBlock

我在这个问题的评论中发现其他人有同样的问题:iOS 4应用程序在iOS 3.1.3启动时崩溃:未找到符号:__ NSConcreteStackBlock

#1


7  

The problem was that in 'Other Linker Flags' option in xcode I had -weak_library /usr/lib/libSystem.B.dylib changing this to -weak-lSystem fixes the problem

问题是在xcode的'Other Linker Flags'选项中我有-weak_library /usr/lib/libSystem.B.dylib将此更改为-weak-lSystem修复了问题

I found other person with the same problem in a comment in this question: iOS 4 app crashes at startup on iOS 3.1.3: Symbol not found: __NSConcreteStackBlock

我在这个问题的评论中发现其他人有同样的问题:iOS 4应用程序在iOS 3.1.3启动时崩溃:未找到符号:__ NSConcreteStackBlock