Search code examples
iphoneioscocos2d-iphonegamekitgame-center

My GKMatch has no players...?


  • I successfully made a matchmaking screen appear.
  • I run my game in my iPhone and also in the simulator.
  • In both cases I log in with a different Game Center account.
  • I go to the matchmaking screen in both games. I press "play now". Both games begin looking for a match.
  • Finally, both games find a match and call the function below:

- (void)matchmakerViewController:(GKMatchmakerViewController *)viewController didFindMatch:(GKMatch *)match
{
    self.myMatch = match;
    NSLog(@"%d",[[self.myMatch playerIDs]count]);

}

But my console returns 0. Shouldn't it return 2 instead?


Solution

  • Could it be that you are not actually connecting them?

    Are you in fact using GKMatchmaker and GKMatchmakerViewController?

    In your testing, you are sure you are using TWO DIFFERENT game center accounts?

    I'm afraid I'm not familiar with the game center system.