【问题标题】:iOS 6 Simulator Game Center authenticateHandler crashiOS 6 Simulator Game Center authenticationHandler 崩溃
【发布时间】:2012-09-13 12:54:02
【问题描述】:

在 iOS 6 中,现在需要像这样对游戏中心进行身份验证:

GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
    if (viewController != nil)
    {


        [[AppDelegate sharedDelegate].viewController  presentModalViewController:viewController animated:YES];


         }
         else if (localPlayer.isAuthenticated)
         {   
             [self authenticatedGC];
         }
         else
         {
             [self disableGC];
         }
        };

}

这段代码在我的运行 iOS6 的 iphone 4 上运行良好,但在我的 iOS 6 模拟器上崩溃并出现此堆栈跟踪:

0 objc_msgSend
1 -[GKLocalPlayer setAuthenticateHandler:]
2 -[GCHelper authenticateLocalUser]
3 -[AppDelegate applicationDidFinishLaunching

我试图重新安装 xcode,以为模拟器缺少 iOS 6 sdk 或其他东西,但它仍然在这里崩溃。

有什么想法吗?

谢谢!

【问题讨论】:

    标签: xcode ios-simulator ios6


    【解决方案1】:

    您可能想结帐this question,因为您的应用程序可能由于自动旋转问题和游戏中心而崩溃,而不是身份验证机制本身

    【讨论】:

    • 我已经实现了该解决方案,它不会在设备上崩溃,并且旋转也可以正常工作。这只是 iOS 6.0 模拟器中的一次崩溃。谢谢!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多