IOS Development: Why loading loadScoresWithCompletionHandler does not return?

I play with the Game Kit API and I have a very simple block of code that never returns, even with an error ...

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
       {
        .
        .
        .

Since there is no error, I do not know how to solve this. Does anyone have any ideas what is wrong or how can I further investigate what is wrong?

Thank you very much for your wisdom!

UPDATE: Finally, I was able to return this block of code, so I do not quite understand why. To return it, I sent an invoice to the leaderboard shortly before trying to get it. It’s strange that I had an account before, so I don’t know why the publication of the assessment affected this problem.

+3
source share
2 answers

, . , "" , , . , . DavidD, , . , - .

0

, ​​ - iOS 4.3.

(: gadgetsdna.com)

: GameKit , .

100%, , iOS, -, iOS 4.3 SDK.

+4

Source: https://habr.com/ru/post/1785790/


All Articles