IOS之自动创建项目各个文件夹
生活随笔
收集整理的這篇文章主要介紹了
IOS之自动创建项目各个文件夹
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
IOS之自動創建項目各個文件夾
// // main.m // AutoCreateGroup // // Created by lujun on 2021/10/29. //#import <Foundation/Foundation.h>int main(int argc, const char * argv[]) {NSFileManager *fileManager = [NSFileManager defaultManager ];NSString *filePath = @"/Users/lujun/Desktop/Main"; // filePath = [filePath stringByAppendingPathComponent:@"Controller"];NSMutableArray *filePathArray = [NSMutableArray array];[filePathArray addObject:[filePath stringByAppendingPathComponent:@"Controller"]];[filePathArray addObject:[filePath stringByAppendingPathComponent:@"Model"]];[filePathArray addObject:[filePath stringByAppendingPathComponent:@"View"]];[filePathArray addObject:[filePath stringByAppendingPathComponent:@"Other"]];BOOL isDi = YES;for(int i=0;i<4;i++){if(![fileManager fileExistsAtPath:filePathArray[i] isDirectory:&isDi]){BOOL b1 = [fileManager createDirectoryAtPath:filePathArray[i] withIntermediateDirectories:YES attributes:nil error:nil];NSLog(@"%id",b1);}}NSLog(@"%@",filePathArray);return 0; }總結
以上是生活随笔為你收集整理的IOS之自动创建项目各个文件夹的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何创造出更优秀的用户体验?
- 下一篇: 细数25个硅谷最热创业公司 寻找创业灵感