I want to add an image to a byte array. The following code gives me an error. I think i have not done it correctly.
Error
Field has incomplete type 'NSData *__strong[]'
In the .m
file
@interface MyViewController() {
NSData *byteArray[];
}
inside the method
NSData *imgD = UIImageJPEGRepresentation(img1, 0.1);
NSData *imgD2 = UIImageJPEGRepresentation(img2, 0.1);
NSData *imgD3 = UIImageJPEGRepresentation(img13, 0.1);
[byteArray addObject:imgD];
[byteArray addObject:imgD2];
[byteArray addObject:imgD3];