Skip to content

Commit 855b8ba

Browse files
committed
fix bug
1 parent 56f969b commit 855b8ba

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff 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

YBModelFile/YBModelFile.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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
//创建一个工具工作空间

0 commit comments

Comments
 (0)