What I would suggest is implementing a protocol to transfer NSData objects between devices. Have a standardised packet that you send between devices. Such as
type | length | data....
The type and length should be integers so when they get to the other side you know exactly how big they are. The length will then tell you how long your actual packet is.
A simple example
// method received "(id) data" which can be UIImage, NSString, NSDictionary, NSArray
// 1 -> Image
// 2 -> JSON
uint32_t type;
if ([data isKindOfClass:[UIImage class]]) {
data = UIImageJPEGRepresentation((UIImage *)data, 1.0);
type = 0;
} else {
data = [data JSONData];
type = 1;
}
uint32_t length = [data length];
NSMutableData *packet = [NSMutableData dataWithCapacity:length + (INT_32_LENGTH * 2)];
[packet appendBytes:&type length:INT_32_LENGTH];
[packet appendBytes:&length length:INT_32_LENGTH];
[packet appendData:data];
Then on the other end you just read the length of the packet check the type and convert back to the correct object type. For Images send as binary packet and for anything else send as JSON.
Hope that helps.