Created
May 12, 2014 10:38
-
-
Save dm-z/835152b06bac17ecfeaa to your computer and use it in GitHub Desktop.
Save UIImage to disk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)saveTestImage:(UIImage *)image | |
{ | |
NSArray * paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString * basePath = ([paths count] > 0) ? [paths objectAtIndex:0] : nil; | |
NSData * binaryImageData = UIImagePNGRepresentation(image); | |
[binaryImageData writeToFile:[basePath stringByAppendingPathComponent:@"TestImage.png"] atomically:YES]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment