[英]iOS GameCenter Integration Error
在DidFinishLaunchingWithOptions中,我嘗試使用此代碼對播放器進行身份驗證
// Authenticate Player with Game Center
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
// Handle the call back from Game Center Authentication
[localPlayer localPlayer.authenticateHandler:^(NSError *error)
{
if (localPlayer.isAuthenticated)
{
// Player was successfully authenticated.
// Perform additional tasks for the authenticated player.
}
else if (error != nil)
{
NSLog(@"error : %@", [error description]);
}
}];
return YES;
}
但是我在這條線上出現了錯誤[localPlayer localPlayer.authenticateHandler:^(NSError *error)
說缺少方括號']',並指向句號'。 我無法正常工作,謝謝
您沒有向本地播放器實例發送消息,因此這在語法上是不正確的。
請閱讀 。
您應該執行以下操作:
[localPlayer setAuthenticateHandler:
^(UIViewController *viewController, NSError *error) {
// ...
}
];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.