I develop an application with Leaderboard and Achievements. The current application version works correctly with GameKit but the code was old.
Then I update the code with the last GameKit API.
When I just try to authenticate the user, I have a crash from GameKit with the following backtrace :
thread #1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
frame #0: 0x000000010fccaf11 libobjc.A.dylib`objc_exception_throw
frame #1: 0x0000000107e88e2b CoreFoundation`-[NSCache setObject:forKey:cost:] + 379
frame #2: 0x0000000124cc0346 GameCenterUI`-[GKUITheme resourceWithName:missingHandler:] + 97
frame #3: 0x0000000124cc01c1 GameCenterUI`-[GKUITheme eventIconImage] + 93
frame #4: 0x0000000124ccd65e GameCenterUI`-[GKNotificationBannerView initWithTitle:message:] + 57
frame #5: 0x0000000124cd02bc GameCenterUI`+[GKNotificationBanner bannerViewWithTitle:image:player:message:actionMessage:] + 169
frame #6: 0x0000000124cd0204 GameCenterUI`+[GKNotificationBanner bannerViewWithTitle:image:player:message:] + 76
frame #7: 0x0000000124cd030e GameCenterUI`+[GKNotificationBanner showBannerWithTitle:message:completionHandler:] + 61
frame #8: 0x0000000124cd992d GameCenterUI`-[GKLocalPlayer(AuthenticationPrivate) _showWelcomeBanner] + 1027
frame #9: 0x0000000124cdacc4 GameCenterUI`-[GKLocalPlayer(AuthenticationPrivate) authenticationDidCompleteWithError:] + 1786
frame #10: 0x0000000124cda432 GameCenterUI`__83-[GKLocalPlayer(AuthenticationPrivate) startAuthenticationForExistingPrimaryPlayer]_block_invoke + 2600
frame #11: 0x0000000124add1bc GameCenterFoundation`-[GKLocalPlayerAuthenticator _handleAuthResponse:error:handler:] + 3786
frame #12: 0x0000000124adb93a GameCenterFoundation`__133-[GKLocalPlayerAuthenticator _authenticateUsingAuthUI:authenticationResults:usernameEditable:authUIDismissHandler:completionHandler:]_block_invoke.170 + 1035
frame #13: 0x0000000107ea336c CoreFoundation`__invoking___ + 140
frame #14: 0x0000000107ea3240 CoreFoundation`-[NSInvocation invoke] + 320
frame #15: 0x0000000124b456c8 GameCenterFoundation`-[NSInvocation(GKProxyHelpers) _gkInvokeOnce] + 27
frame #16: 0x0000000124b34afa GameCenterFoundation`__53-[GKDaemonProxy connection:handleInvocation:isReply:]_block_invoke + 26
frame #17: 0x00000001107732f7 libdispatch.dylib`_dispatch_call_block_and_release + 12
frame #18: 0x000000011077433d libdispatch.dylib`_dispatch_client_callout + 8
frame #19: 0x000000011077f5f9 libdispatch.dylib`_dispatch_main_queue_callback_4CF + 628
frame #20: 0x0000000107ee1e39 CoreFoundation`__CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9
frame #21: 0x0000000107ea6462 CoreFoundation`__CFRunLoopRun + 2402
frame #22: 0x0000000107ea5889 CoreFoundation`CFRunLoopRunSpecific + 409
frame #23: 0x0000000112a4f9c6 GraphicsServices`GSEventRunModal + 62
frame #24: 0x000000010c8bb5d6 UIKit`UIApplicationMain + 159
I don't know what is the [GKUITheme eventIconImage] method...
Here my simple code in a button in a simple viewController :
[GKLocalPlayer localPlayer].authenticateHandler=^(UIViewController *viewController, NSError *error) {
if (viewController != nil){
//
} else if ([GKLocalPlayer localPlayer].isAuthenticated) {
NSLog(@"Player authenticated");
} else {
NSLog(@"Player non authenticated");
}
};