Created
May 26, 2015 04:47
-
-
Save phnessu4/4cac9224c94b2bdd01d1 to your computer and use it in GitHub Desktop.
Revisions
-
phnessu4 created this gist
May 26, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ 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);