title: Sending Data to Other Players - Game Center
body: <p>I am developing a simple game center multiplayer game. i did manage almost everything except sending messeage to players. what i mean, i can invite player to play game, game is starts etc.</p>
  
  <p>regarding apple documentation i am using following method to send data but it' doesn't work at all. </p>
  
  <pre><code>const char *bytes = "123";  
  NSData *packet = [NSData dataWithBytes:&amp;bytes length:3];
  [myMatch sendDataToAllPlayers: packet withDataMode: GKMatchSendDataUnreliable error:nil];
  </code></pre>
  
  <p>if possible a working sample would be great.
  many thanks.</p>
  
  <p>I did pretty much same.</p>
  
  <pre><code>NSError *errorTransmit; 
  const char *bytes = "asd";  
  NSData *packet = [NSData dataWithBytes:&amp;bytes length:3];
  [myMatch sendDataToAllPlayers: packet withDataMode: GKMatchSendDataUnreliable error:&amp;errorTransmit];    
  if (errorTransmit != nil)
  
      NSLog(@"Error sending data to peers: %@", [errorTransmit localizedDescription]);
  }
  </code></pre>
  
  <p>but when code reach 
  NSLog(@"Error sending data to peers: %@", [errorTransmit localizedDescription]);
  I am getting Program received signal:  “EXC_BAD_ACCESS”.
  that's why i can't see what is going on.</p>