0

How do you try to save a photo to a directory that I made

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;


    NSArray *directoryNames = [NSArray arrayWithObjects:@"tops",@"bottom",@"right",@"left",nil];
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0]; // Get documents folder

    for (int i = 0; i < [directoryNames count] ; i++) {
        NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:directoryNames[i]];
        if (![[NSFileManager defaultManager] fileExistsAtPath:dataPath])
            [[NSFileManager defaultManager] createDirectoryAtPath:dataPath withIntermediateDirectories:NO attributes:nil error:nil]; //Create folder
    }
}

I am making the user to take a picture inside the app and want the user to choose which directory he wants to save into. How should I do this?

AppleDevram
  • 67
  • 1
  • 12
  • You should use to asset library. You should read more information it doesn't do in a hurry. You ought to understand asset library work algorithm – Misha Vyrko Aug 06 '13 at 08:41
  • Check this link http://stackoverflow.com/questions/6821517/save-an-image-to-application-documents-folder-from-uiview-on-ios – IOS Dev Aug 06 '13 at 08:57

0 Answers0