ios - Implement my own a custom GKTurnBasedMatchmakerViewController -


i'm sure there questions similar this, couldn't find example. i'm trying recreate apple gkturnbasedmatchmakerviewcontroller turn based game own custom interface turn based iphone game. i'm having trouble getting options display correctly hoping had working example. current code this:

-(void)getcurrentgamesfromserver  { [gkturnbasedmatch loadmatcheswithcompletionhandler:^(nsarray *matches, nserror *error) {     if(matches){         (gkturnbasedmatch *mymatch in matches) {              //this is, believe, need consider invitations.  available instance methods provided gc are: acceptinvitewithcompletionhandler , declineinvitewithcompletionhandler              if(mymatch.status == 1){ //ongoing game                 if([mymatch.currentparticipant.playerid isequaltostring:[gklocalplayer localplayer].playerid]){ //if it's turn                     //here need populate table adding our matches mcurrentgamesarray.  after matches have been added, reload tableview                      nslog(@"active game turn");                     [self.mcurrentgamesarray addobject:mymatch];                  }                 else{                     nslog(@"other turn or invite player waiting hear you");                 }             }          }     }     [_mcurrentgamestableview reloaddata]; }]; } 

as can see, games i'm grabbing right games status 1 (ongoing game) , current participant id id.

to games not turn, tried doing games not id, included invites , couldn't figure out how separate them out.

basically, i'd have section of games turn, section not turn games still active, section of completed old games, , section invites. have working example, or page can send me explains best practices i'm trying do? help.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -