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: Development <email@hidden>
- Date: Mon, 8 Feb 2010 10:47:31 -0700
I have tried to send the NSData directly. The problem is that the image is getting corrupted somewhere or some how. All I get on the other side is an image of the correct size but only about the first 3 or 4 lies of the image appear. I have tried about 4 different methods of sending this data and thats the best result I get any other time the app crashes.
On Feb 8, 2010, at 10:23 AM, Jens Alfke wrote:
>
> 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