gpt4 book ai didi

iphone - iOS 开发 : Why doesn't loadScoresWithCompletionHandler ever return?

转载 作者:塔克拉玛干 更新时间:2023-11-02 07:52:39 24 4
gpt4 key购买 nike

我正在玩 Game Kit API,我有一个非常简单的代码块,它永远不会返回,即使出现错误也不会......

GKLeaderboard *pointsRequest = [[GKLeaderboard alloc] initWithPlayerIDs:[match playerIDs]];
if (pointsRequest != nil)
{
//Set the points leaderboard category id
[pointsRequest setCategory:kPOINTS_LEADERBOARD_ID];
[pointsRequest loadScoresWithCompletionHandler: ^(NSArray *scores, NSError *error)
{
if (error != nil) //THIS LINE NEVER GETS HIT
{
NSLog(@"%@", [error localizedDescription]);
}

if (scores != nil) //NOR DOES THIS LINE
{
.
.
.

由于没有错误,我什至不确定如何解决这个问题。有没有人知道哪里出了问题,或者我该如何进一步调查哪里出了问题?

非常感谢您的智慧!

更新:我终于能够让这段代码返回,虽然我不完全明白为什么。为了让它返回,我在尝试检索它之前不久向排行榜发布了一个分数。奇怪的是我之前在那里发布了一个分数,所以我不知道为什么发布一个分数对这个问题有什么影响。

最佳答案

这实际上可能是一个刚刚在 iOS 4.3 beta 中得到纠正的错误。

来自开发者说明(来源:gadgetsdna.com)

FIXED: GameKit now reports an error when achievement or a leaderboard score is not actually submitted.

我不能 100% 确定这与您的问题有关,但唯一的方法是注册 iOS 开发人员计划并测试最新的测试版,或者等待最终的 iOS 4.3 SDK 发布.

关于iphone - iOS 开发 : Why doesn't loadScoresWithCompletionHandler ever return?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4707818/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com