2012-09-21 61 views
0

在iOS 6中現在有必要來驗證遊戲中心這樣的:的iOS 6模擬器遊戲中心authenticateHandler崩潰

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]; 
     } 
     }; 

} 

此代碼運行在我的iPhone 4運行iOS6的很好,但在我的iOS 6模擬器崩潰該堆棧跟蹤:

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

我試圖重新安裝的Xcode思維模擬器缺少的iOS 6 SDK或東西,但它仍然崩潰這裏。

任何想法?

謝謝!

回答

0

你可能想籤this question,因爲你的應用程序可能會崩潰,由於自轉問題和遊戲中心,而不是認證機制本身

+0

我已經有解決方案實現的,並沒有設備和旋轉上崩潰也適用。這只是iOS 6.0模擬器的崩潰。謝謝! –