if you need to get an array of bytes from an Image, try this approach:
Get the data for the given image
UIImage *image = [UIImage imageNamed:@"image.png"];
NSData *data = UIImagePNGRepresentation(image);
// You can use UIImageJPEGRepresentation() if you need a jpg rather than a png
Then, use a method like this to return an NSArray of bytes
- (NSArray*) arrayOfBytesFromData:(NSData*) data
{
if (data.length > 0)
{
NSMutableArray *array = [NSMutableArray arrayWithCapacity:data.length];
NSUInteger i = 0;
for (i = 0; i < data.length; i++)
{
unsigned char byteFromArray = data.bytes[i];
[array addObject:[NSValue valueWithBytes:&byteFromArray
objCType:@encode(unsigned char)]];
}
return [NSArray arrayWithArray:array];
}
return nil;
}
Loop through the array and form your JSON from there.
Good Luck!