0
我只是複製/粘貼從蘋果開發libary到Xcode的這個代碼,Xcode中給了我很多基本的語法錯誤..使用Apple Dev代碼時出錯?
- (void) authenticateLocalPlayer
{
GKLocalPlayer *localPlayer = [GKLocalPlayer localPlayer];
localPlayer.authenticateHandler = ^(UIViewController *viewController, NSError *error){
if (viewController != nil)
{
[self showAuthenticationDialogWhenReasonable: viewController
}
else if (localPlayer.isAuthenticated)
{
[self authenticatedPlayer: localPlayer];
}
else
{
[self disableGameCenter];
}
}];
}
難道我做錯了什麼?
你建設iOS6的?該@property authenticateHandler根據文檔 – geraldWilliam
該代碼是直接取自文檔,這是iOS6的不可用在早期版本的操作系統,這裏的鏈接http://developer.apple.com/library/ios/#文檔/ NetworkingInternet /概念/ GameKit_Guide /用戶/ Users.html#// apple_ref/DOC/UID/TP40008304-CH8-SW6 – Phil
正確的,但在Xcode中,在目標>摘要>部署目標是你瞄準iOS6的? – geraldWilliam