Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios7 iOS 7.0中游戏中心排行榜分数上传失败_Ios7 - Fatal编程技术网

Ios7 iOS 7.0中游戏中心排行榜分数上传失败

Ios7 iOS 7.0中游戏中心排行榜分数上传失败,ios7,Ios7,我经常在谷歌上搜索,因为我在iOS 7中实现游戏中心排行榜时遇到了问题。。所以我有一件很重要的事情,那就是解决这个问题。在iOS 7.0中,我们应该使用标识符而不是类别,因为类别在iOS 7.0中已被弃用。。我可以从这里得到这个事实 所以我用了标识符。。。但它仍然面临着同样的问题。。。分数上传失败 下面是我报告分数的代码 GKScore *scoreReporter = [[GKScore alloc] initWithLeaderboardIdentifier: identifier]; sc

我经常在谷歌上搜索,因为我在iOS 7中实现游戏中心排行榜时遇到了问题。。所以我有一件很重要的事情,那就是解决这个问题。在iOS 7.0中,我们应该使用标识符而不是类别,因为类别在iOS 7.0中已被弃用。。我可以从这里得到这个事实

所以我用了标识符。。。但它仍然面临着同样的问题。。。分数上传失败

下面是我报告分数的代码

GKScore *scoreReporter = [[GKScore alloc] initWithLeaderboardIdentifier: identifier];
scoreReporter.value = score;
scoreReporter.context = 0;
scoreReporter.shouldSetDefaultLeaderboard = YES;
NSArray *scores = @[scoreReporter];

[GKScore reportScores:scores withCompletionHandler:^(NSError *error) {
    //Do something interesting here.
    [self callDelegateOnMainThread: @selector(scoreReported:) withArg: NULL error: error];
}];
当报告评分时,它显示错误,错误是由于一个或多个参数无效,请求的操作无法完成


有什么解决办法吗?我几乎花了两天的时间,但没有得到任何有趣的东西。。谁能给我一个解决办法?需要帮忙吗。。谢谢。

我通过删除线路解决了我的问题

scoreReporter.shouldSetDefaultLeaderboard = YES;
:希望这能帮助其他与我面临相同问题的开发人员