我一直在使用苹果示例GKTapper(2010年)来管理分数很长一段时间。它停止在iOS6中工作。我不确定该怎么办,因为我添加了以下片段,排行榜仍然说“无法加载”。 (我能够登录,但没有加载分数)。请帮助!
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] \
compare:v options:NSNumericSearch] == NSOrderedAscending)
- (void) authenticateLocalUser
{
if([GKLocalPlayer localPlayer].authenticated == NO)
{
if (SYSTEM_VERSION_LESS_THAN(@"6.0"))
{
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error)
{
[self callDelegateOnMainThread: @selector(processGameCenterAuth:) withArg: NULL error: error];
}];
}else{
[[GKLocalPlayer localPlayer] setAuthenticateHandler:(^(UIViewController* viewcontroller, NSError *error) {
if (!error && viewcontroller)
{
[self callDelegateOnMainThread: @selector(processGameCenterAuth:) withArg: NULL error: error];
}
else
{
//do nothing
}
})];
}
}
}
答案 0 :(得分:0)
对于iOS 6,您必须自己呈现UIViewController。这是在GameCenter Auth过程中完成的吗?
你需要的代码如下:
[self presentViewController: viewcontroller];
在街区内。