Created
May 26, 2015 04:47
-
-
Save phnessu4/4cac9224c94b2bdd01d1 to your computer and use it in GitHub Desktop.
save file to path
This file contains 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
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask,YES); | |
NSString *ourDocumentPath =[documentPaths objectAtIndex:0]; | |
NSString * filepath = [ourDocumentPath stringByAppendingString:[NSString stringWithFormat:@"image%lu.png",(unsigned long)index]]; | |
// [fileManager createDirectoryAtPath:filepath withIntermediateDirectories:YES attributes:nil error:nil]; | |
[fileManager createFileAtPath:filepath | |
contents:UIImagePNGRepresentation(image) | |
attributes:nil]; | |
NSLog(@"-------file %@",filepath); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment