0

これは私のコーディングでローカルのトップ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'
4

2 に答える 2

2

エラーが示すように、コールバックデリゲートとして使用しているオブジェクトOFHighScoreServiceはセレクターを認識しませんcanReceiveCallbacksNow。OpenFeintのドキュメントによると、コールバックはOFCallbackableこれを定義するプロトコルを実装する必要があります。関数を実装するだけです。たとえば、YES常に関数を返すようにします。

于 2011-03-11T12:18:37.617 に答える
0

OpenFeintは、特定のリーダーボードにプレイヤーごとの最新の予選スコアのみを保存します。リーダーボードの複数のスロットにランク付けされているユーザーは表示されません。

于 2011-04-05T17:22:17.707 に答える