iOS 6 SDK を使用するアプリでのゲーム センターの統合に問題があります。実際、Apple のサンプル コードを使用していますが、不完全なように見えます。
私はこのコードを試しました:
-(void) authenticateLocalPlayer {
GKLocalPlayer* localPlayer =
[GKLocalPlayer localPlayer];
localPlayer.authenticateHandler =
^(UIViewController *loginVC,
NSError *error) {
[self setLastError:error];
if ([GKLocalPlayer localPlayer].authenticated)
{
// authentication successful
[self enableGameCenterForPlayer:[GKLocalPlayer localPlayer]];
}
else if (loginVC)
{
// player not logged in yet, present the vc
[self pauseGame];
[self presentLoginVC:loginVC];
}
else
{
// authentication failed, provide graceful fallback
[self disableGameCenter];
}
};
}
しかし、問題は、、、、enableGameCenterForPlayer
disableGameCenterが実装されたメソッドではなく、次のように返されることです。pauseGame
presentLoginVC
Instance method '-enableGameCenterForPlayer:' not found (return type defaults to 'id')
この問題を解決するにはどうすればよいですか?
ありがとう