2013-05-02 2 views
1

Game Center를 사용하여 차례 기반 게임을 개발 중입니다. 다음 코드 ::모든 GKInvite의 목록을 TableView에 나열하십시오.

GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite* acceptedInvite, NSArray *playersToInvite) 
    { 
     if(acceptedInvite != nil) 
     { 
      // Get a match for the invite we obtained... 

      NSLog(@"Valor de la invitacion %@",acceptedInvite); 

      [[GKMatchmaker sharedMatchmaker] matchForInvite:acceptedInvite completionHandler:^(GKMatch *match, NSError *error) 

      { 
       if(match != nil) 
       { 
        NSLog(@"match != nil: "); 

       } 
       else if(error != nil) 
       { 
        NSLog(@"ERROR: From matchForInvite: %@", [error description]); 
       } 
       else 
       { 
        NSLog(@"ERROR: Unexpected return from matchForInvite..."); 
       } 
      }]; 
     } 
    }; 

나는 내가있는 TableView에서 그들을 가지고받은 모든 GKInvite의 목록을 가지고 싶은 woudl를 사용하여 재생하는 초대장을 처리하고 나중에 사용자가 초대를 수락하기로 결정한다 게임을하거나 거부 할 수 있습니다. 물론 모든 게임 센터 옵션을 처리하기 위해 내 자신의보기를 사용하고 있습니다.

모든 솔루션 ??

답변

0

턴 기반 게임의 경우 GKMatchmaker 대신 GKTurnBasedMatchmaker을 사용해야합니다.

또한 사용자가 초대를 스 와이프하여 수락 한 게임에 대해서만 GKTurnBasedMatch 개의 개체를 볼 수 있습니다.

관련 문제