0
我的游戏在iOS5中一年来一直处于完美状态。在更新它与iOS6一起使用后,它现在在尝试在Game Center中发送分数时崩溃。它崩溃的代码iOS6中的游戏中心崩溃
- (void)sendScore:(GKScore *)score {
[score reportScoreWithCompletionHandler:^(NSError *error) {
dispatch_async(dispatch_get_main_queue(), ^(void)
{
if (error == NULL) {
NSLog(@"Successfully sent score!");
[scoresToReport removeObject:score];
} else {
NSLog(@"Score failed to send... will try again later. Reason: %@", error.localizedDescription);
}
});
}];
}
的reportScoreWithCompletionHandler
线我在做什么错在这里?
更新
已经观察了约一点似乎也有可能是authenticateWithCompletionHandler
一个问题...我该代码如下..如果是这样责怪我怎么可以更新它,它的工作原理?
- (void)authenticateLocalUser {
if (!gameCenterAvailable) return;
NSLog(@"Authenticating local user...");
if ([GKLocalPlayer localPlayer].authenticated == NO) {
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:nil];
} else {
NSLog(@"Already authenticated!");
}
}
我们可以得到堆栈跟踪吗? –