I have a method in my app that I would like to write hex values into a file (essentially creating an image from the written bytes). I can't seem to figure out how to encode the values properly to produce the image. Any suggestion would be appreciated - thanks.
- (void)makeImage {
@autoreleasepool {
NSString* hexValues = @"8950..." // these are the hex bytes that make up the image file
NSString* fileName = @"image.png";
NSString* homeDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Desktop/"];
NSString* fullPath = [homeDir stringByAppendingPathComponent:fileName];
NSError* error = nil;
[lastLine writeToFile:fullPath atomically:NO encoding:NSASCIIStringEncoding error:&error];
}