File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ iOS 效率工具:自动生成 Model 文件(数据模型) / iOS efficiency
44
55技术原理博客:[ iOS 效率工具:自动生成 Model 文件] ( https://www.jianshu.com/p/f30cf05054c6 )
66
7+ 注意:仅在模拟器下运行有效
78
89## 特性
910
Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ + (void)createFileWithName:(NSString *)name data:(id)data {
2424
2525+ (void )createFileWithName : (NSString *)name data : (id )data path : (nullable NSString *)path {
2626#if DEBUG
27+ if (TARGET_OS_IPHONE) {
28+ NSAssert (0 , @" 请用模拟器运行" );
29+ }
2730 [self _createFileWithName: name data: data path: path];
2831#endif
2932}
@@ -145,8 +148,9 @@ - (void)creatWithPath:(NSString *)path {
145148 if (!path) {
146149 // 找到桌面路径
147150 NSString *bundle = [[NSBundle mainBundle ] resourcePath ];
151+ if (!bundle) NSAssert(0 , @" 自动获取桌面路径失败,请尝试添加文件路径" );
148152 path = [[bundle substringToIndex: [bundle rangeOfString: @" Library" ].location] stringByAppendingFormat: @" Desktop" ];
149- if (!path) NSAssert(0 , @" 自动获取桌面路径失败,请尝试添加文件路径" );;
153+ if (!path) NSAssert(0 , @" 自动获取桌面路径失败,请尝试添加文件路径" );
150154 }
151155
152156 // 创建一个工具工作空间
You can’t perform that action at this time.
0 commit comments