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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to