Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.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
Iphone 如何从openfeint获得本地前10高分_Iphone_Cocos2d Iphone_Openfeint - Fatal编程技术网

Iphone 如何从openfeint获得本地前10高分

Iphone 如何从openfeint获得本地前10高分,iphone,cocos2d-iphone,openfeint,Iphone,Cocos2d Iphone,Openfeint,这是我的编码,我用它来获得本地前10名的高分,但出现了调试终止错误 [OFHighScoreService getPageWithLoggedInUserForLeaderboard: theLeaderboardID onSuccess:OFDelegate(self, @selector(_scoresDownloaded:)) onFailure:OFDelegate()]; 选择器:- - (void)_scoresDownloaded:(OFPaginatedSeri

这是我的编码,我用它来获得本地前10名的高分,但出现了调试终止错误

[OFHighScoreService getPageWithLoggedInUserForLeaderboard: theLeaderboardID onSuccess:OFDelegate(self, @selector(_scoresDownloaded:))
        onFailure:OFDelegate()];
选择器:-

- (void)_scoresDownloaded:(OFPaginatedSeries*)page
{

    NSMutableArray* highscores = nil;

    if ([page count] > 0)
    {
        if ([[page objectAtIndex:0] isKindOfClass:[OFTableSectionDescription class]])
        {
            highscores = [(OFTableSectionDescription*)[page objectAtIndex:0] page].objects;
        }
        else
        {
            highscores = page.objects;
        }
    }
   NSString *userID = [OpenFeint lastLoggedInUserName];
    for (OFHighScore* score in highscores)
    {
        ccColor3B theColor = ccBLACK;
        if ([score.user.name isEqualToString: userID] ) {
            //score now contains the users data... Do what I want with it.
                        NSLog(@"%d %@ %d", score.rank, score.user.name, score.score);
                        break;

        }

    }
}
这是我的控制台窗口错误:-

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Levelone canReceiveCallbacksNow]: unrecognized selector sent to instance 0x6af2070'
*** Call stack at first throw:

terminate called after throwing an instance of 'NSException'

正如错误所述,您用作HighScoreService的
回调委托的对象无法识别选择器
canReceiveCallbacksNow
。根据OpenFeint文档,回调必须实现可调用的
协议,该协议定义了这一点。只需实现该功能,例如,让它始终返回
YES

OpenFeint仅在给定排行榜上存储每位玩家的最新排位赛分数。任何用户都不会在排行榜上排名超过一位。

非常感谢您的帮助。但本地设备的得分只有一分(前1名)。我想要本地设备播放器的前10名,有什么问题吗?但是本地设备只有一分(前1名)。我想要本地设备播放器的前10名,有什么问题吗