将照片保存到目录

时间:2013-08-06 08:29:16

标签: ios save photo

如何尝试将照片保存到我制作的目录

- (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
    }
}

我让用户在应用程序内部拍照并希望用户选择要保存的目录。我该怎么做?

0 个答案:

没有答案