创建文件夹

时间:2015-05-13 19:33:09   收藏:0   阅读:104
 NSString *homePath = NSHomeDirectory();
    NSString *systemLogPath = [homePath stringByAppendingPathComponent:@"Documents/DearMob/SystemLog"];
    NSLog(@"%@",systemLogPath);
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsPath = [paths objectAtIndex:0];
    
    NSFileManager *fileManager = [NSFileManager defaultManager];
    NSString *testDirectory = [documentsPath stringByAppendingPathComponent:@"DearMob/SystemLog"];
    NSLog(@"%@",testDirectory);
    // 创建目录
    BOOL res=[fileManager createDirectoryAtPath:systemLogPath withIntermediateDirectories:YES attributes:nil error:nil];

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!