私は長い間、Apple のサンプル 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
}
})];
}
}
}