iPhone: Lost with GK
iPhone: Lost with GK
- Subject: iPhone: Lost with GK
- From: Development <email@hidden>
- Date: Sat, 6 Feb 2010 22:36:53 -0700
I'm trying to send an image in NSData format via bluetooth from one device to another. Below is my code:
-(void)sendDataToPeer:(NSString*)peerID andSession:(GKSession*)session
{
if ([connections objectForKey:peerID]) {
[delegate cardSent:[session displayNameForPeer:peerID]];
}
NSError * error;
NSData * data = [delegate cardData];
NSLog(@"About to send data %i",[data length]);
int started = [session sendData:data toPeers:[NSArray arrayWithObject:peerID]
withDataMode:GKSendDataReliable error:&error];
NSLog(@"Data Sent %i Error:%@",started,error);
if(started){
[connections setObject:@"Sent" forKey:peerID];
[delegate cardSent:peerID];
}
else {
[delegate cardFailed];
}
}
And when I try to send, this is the error I get every time:
Error Domain=com.apple.gamekit.GKSessionErrorDomain Code=30202 UserInfo=0x145e80 "Send data error."
Any idea what I'm doing wrong?_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden