Cha*_*boy 0 iphone objective-c gamekit
我在cocos2d中总是收到失败,但是当我在基于视图的应用程序中运行此项目时,它会给我成功,并且分数将很容易提交
[[GKLocalPlayer localPlayer] authenticateWithCompletionHandler:^(NSError *error){
if (error ==nil) {
NSLog(@"Success");
} else {
NSLog(@"Fail");
}
}];
GKScore *myScoreValue = [[[GKScore alloc] initWithCategory:@"123"] autorelease];
myScoreValue.value = lastScore;
[myScoreValue reportScoreWithCompletionHandler:^(NSError *error){
if(error != nil){
NSLog(@"Score Submission Failed");
} else {
NSLog(@"Score Submitted");
}
}];
Run Code Online (Sandbox Code Playgroud)
我也有这个错误.我认为当您登录常规游戏中心并试图使用需要沙盒的应用程序进行身份验证时,就会发生这种情况.但我不确定,那只是猜测.
对我有用的是使用Game Center应用程序注销,然后再次尝试应用程序,这将登录或创建沙盒用户.
尽管不是最具描述性的错误消息.