Your response contains all the image bytes as decimal numbers. (255,216
is FF,D8
in hex, which indicates the start of a JPEG image). The following code should work to create an UIImage
from the array of numbers:
NSArray *array = [datadic objectForKey:@"FaceImage"];
NSMutableData *imageData = [NSMutableData dataWithLength:[array count]];
uint8_t *imageBytes = [imageData mutableBytes];
for (NSUInteger i = 0; i < [array count]; i++) {
imageBytes[i] = [array[i] unsignedCharValue];
}
UIImage *image = [UIImage imageWithData:imageData];