大佬教程收集整理的这篇文章主要介绍了GKLocalPlayer在iOS6上使用模态转换错误进行Auth崩溃,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
(为什么?如果您从无网络区域移动到网络区域.)
不幸的是,在iOS6 / XCode 4.5下,它开始崩溃了.或者至少在某些有限的情况下似乎:用户无法使用@L_801_3@的密码和/或不存在的帐户登录.成功登录后,一切顺利.
在登录失败之后,当我去做一些导致进行reauth检查的事情时,我得到了这个:
然后这实际上崩溃了:
这是麻烦的代码:
-(void)authenticateLocalUser { if (!self.checkingLocalPlayer) { self.checkingLocalPlayer = YES; GKLocalPlayer *thisPlayer = [GKLocalPlayer localPlayer]; if (!thisPlayer.authenticated) { [[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) { [self finishGameCenterAuthWithError:error]; } ]; } } }
知道我在这里做错了吗?
@L_489_11@
这似乎有效……
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer]; [localPlayer setAuthenticateHandler:(^(UIViewController* viewcontroller,NSError *error) { //[localPlayer authenticateWithCompletionHandler:^(NSError *error) { OLD CODE! if (localPlayer.isAuthenticated) { //do some stuff } else { UIAlertView *alertView = [[UIAlertView alloc] initWithtitle:@"NOT AUTHORISED" message:@"YOUR'RE NOT LOGGED INTO GC." delegate:self cancelButtontitle:@"OK" otherButtontitles:nil]; [alertView show]; } })];
以上是大佬教程为你收集整理的GKLocalPlayer在iOS6上使用模态转换错误进行Auth崩溃全部内容,希望文章能够帮你解决GKLocalPlayer在iOS6上使用模态转换错误进行Auth崩溃所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。