GameCenterでGKLocalPlayerを認証しようとしています。ただし、Appleが提供するコード
- (void) authenticateLocalPlayer
{
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error) {
if (error == nil)
{
// Insert code here to handle a successful authentication.
NSLog(@"Logged in.");
}
else
{
// Your application can process the error parameter to report the error to the player.
NSLog(@"%@", [error description]);
}
}];
}
私のためにトリックをしていないようです。「GameCenterサーバーに接続できませんでした」というアラートが常に表示されます。「再試行」または「キャンセル」のオプションがあります。どちらのNSLogステートメントも実行されないので、completionHandlerも起動されないと思います。
再試行を押すと、次のエラーが発生します。
Error Domain=GKErrorDomain Code=7 "The requested operation could not be completed because local player is already authenticating." UserInfo=0x8915f80 {NSLocalizedDescription=The requested operation could not be completed because local player is already authenticating.}
誰が何が悪いのか分かりますか?