我一直在寻找几个类似线程中的答案,但我找不到合适的问题。
我在viewDidLoad
中有这个self.currentLeaderBoard = [leaderboards objectForKey:[defaults objectForKey:@"Level"]];
if ([GameCenterManager isGameCenterAvailable]) {
self.gameCenterManager= [[GameCenterManager alloc] init];
[self.gameCenterManager setDelegate: self];
[self.gameCenterManager authenticateLocalUser];
} else {
NSLog(@"Current device doesn't support GameCenter");
}
我尝试以这种方式发送分数:
NSLog(@"Category %@", self.currentLeaderBoard);
[self.gameCenterManager reportScore: 20 forCategory: self.currentLeaderBoard];
[self.gameCenterManager reloadHighScoresForCategory: self.currentLeaderBoard];
我还添加了这个来修复,但它没有帮助:
- (void) processGameCenterAuth: (NSError*) error
{
if(error == NULL)
{
[self.gameCenterManager reloadHighScoresForCategory: self.currentLeaderBoard];
NSLog(@"GAMECENTER OK");
}
else
{
UIAlertView* alert= [[UIAlertView alloc] initWithTitle: @"Game Center Account Required"
message: [NSString stringWithFormat: @"Reason: %@", [error localizedDescription]]
delegate: self cancelButtonTitle: @"Try Again..." otherButtonTitles: NULL];
[alert show];
}
}
但效果总是一样的:
2012-04-15 11:34:31.987 Colors[40146:1bb03] authenticateWithCompletionHandler: enter
2012-04-15 11:34:32.009 Colors[40146:1bb03] authenticateWithCompletionHandler: exit
2012-04-15 11:34:32.010 Colors[40146:1bb03] NORMAL MODE
2012-04-15 11:34:33.163 Colors[40146:1bb03] GAMECENTER OK
2012-04-15 11:34:33.368 Colors[40146:1bb03] Missed Method
2012-04-15 11:34:33.773 Colors[40146:1bb03] Category 2
2012-04-15 11:34:33.851 Colors[40146:1bb03] Missed Method
2012-04-15 11:34:33.989 Colors[40146:1bb03] Missed Method
正如你可以看到它在app工作开始时以及当我尝试报告分数时说“Missed Method”。它根本不报告分数(我在模拟器上尝试过2个不同的帐户) - GC中没有显示任何内容。 当然,我检查了类似是否在iTunes Connect中正确设置,它们似乎是。 http://cl.ly/183a2A2p1M0A2k2c3U2B
请告诉我我做错了什么以及如何解决它...谢谢!
答案 0 :(得分:0)
我已经遇到了同样的问题。错过的方法不是一个你可以忽视它的大问题。
问题可能来自: