title: GameCenter Invitation Handler
body: <p>trying to implement a multiplayer. Using the sample from <a href="https://stackoverflow.com/questions/4574119/game-center-sending-and-receiving-data">Game Center - Sending and receiving data</a>.</p>
  
  <p>Everything seems okay, but in <a href="http://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/Matchmaking/Matchmaking.html#//apple_ref/doc/uid/TP40008304-CH9-SW5" rel="nofollow noreferrer">apple documentation</a> there is also said about invitation handler.</p>
  
  <pre><code>[GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite *acceptedInvite, NSArray *playersToInvite) {
     // Insert application-specific code here to clean up any games in progress.
     if (acceptedInvite) {
          GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithInvite:acceptedInvite] autorelease];
          mmvc.matchmakerDelegate = self;
          [self presentModalViewController:mmvc animated:YES];
      } else if (playersToInvite) {
          GKMatchRequest *request = [[[GKMatchRequest alloc] init] autorelease];
          request.minPlayers = 2;
          request.maxPlayers = 4;
          request.playersToInvite = playersToInvite;
  
          GKMatchmakerViewController *mmvc = [[[GKMatchmakerViewController alloc] initWithMatchRequest:request] autorelease];
          mmvc.matchmakerDelegate = self;
          [self presentModalViewController:mmvc animated:YES];
      }
  };
  </code></pre>
  
  <p>The problem is quite simple: I do not know where to add this code.</p>