Note that there are some explanatory texts on larger screens.

plurals
  1. POGKLocalPlayer Auth Crash on iOS6 with Modal Transition Error
    text
    copied!<p>My app keeps a record of whether it's successfully authenticated with Game Center. When it starts a new game or when the user looks at the score list, if a local player hasn't been successfully authenticated, and if the app isn't in the middle of trying to authenticate a user at the time, it tries again. </p> <p>(Why? In case you've moved from a no-network zone to a network zone.)</p> <p>Unfortunately, under iOS6/XCode 4.5, it's started crashing. Or at least it seems to in certain limited circumstances: when a user fails to log in with a bad password and/or an account that doesn't exist. On a successful login, all is well.</p> <p>After that unsuccessful login, when I go and do something that causes a reauth check to occur I get this:</p> <blockquote> <p>2012-09-25 15:54:47.829 APP NAME [1493:907] <em>*</em> Assertion failure in -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:], /SourceCache/UIKit/UIKit-2372/UIWindowController.m:211</p> </blockquote> <p>Then this actually crashes:</p> <blockquote> <p>2012-09-25 15:55:25.569 APP NAME [1493:907] <strong>* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Attempting to begin a modal transition from &lt;GKModalRootViewController: 0x1cd8b2a0&gt; to &lt;GKHostedAuthenticateViewController: 0x1e31a350&gt; while a transition is already in progress. Wait for viewDidAppear/viewDidDisappear to know the current transition has completed' *</strong> First throw call stack: (0x394932a3 0x31db297f 0x3949315d 0x383fd2af 0x3640377b 0x36402fcf 0x394969c4 0x393edfeb 0x36521733 0x32a83d2d 0x3264b11f 0x3264a4b7 0x3264f1bd 0x39466f3b 0x393d9ebd 0x393d9d49 0x353132eb 0x3636b301 0x7e863 0x7e808) libc++abi.dylib: terminate called throwing an exception</p> </blockquote> <p>This is the troublesome code:</p> <pre><code>-(void)authenticateLocalUser { if (!self.checkingLocalPlayer) { self.checkingLocalPlayer = YES; GKLocalPlayer *thisPlayer = [GKLocalPlayer localPlayer]; if (!thisPlayer.authenticated) { [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) { [self finishGameCenterAuthWithError:error]; } ]; } } } </code></pre> <p>Any idea what I'm doing wrong here?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload