Re: Ok I'm really lost with the game kit here.
Re: Ok I'm really lost with the game kit here.
- Subject: Re: Ok I'm really lost with the game kit here.
- From: Jens Alfke <email@hidden>
- Date: Mon, 8 Feb 2010 09:23:46 -0800
On Feb 7, 2010, at 9:33 PM, Development wrote:
> [session sendData:[NSData dataWithBytes:localPacket.data length:sizeof(localPacket.data)+sizeof(int)] toPeers:[NSArray arrayWithObject:peerID]
The size is wrong. You're computing the size of the packet struct, not the data it points to. (In fact, it looks like there's no way to determine the length of the data a packet points to since it doesn't have a 'size' field.)
Also, if you were expecting this to send the 'index' field, it won't; it just sends the data field.
If you have an image in an NSData, why not just send that NSData object?
—Jens_______________________________________________
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