File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -242,12 +242,9 @@ -(void)modelSetValue:(LKDBProperty *)property value:(id)value
242
242
// /参试获取属性的Class
243
243
Class columnClass = NSClassFromString (property.propertyType );
244
244
245
- id modelValue = value;
246
- if ([value length ] == 0 )
247
- {
248
- modelValue = nil ;
249
- }
250
- else if (columnClass == nil )
245
+ id modelValue = nil ;
246
+
247
+ if (columnClass == nil )
251
248
{
252
249
// /当找不到 class 时,就是 基础类型 int,float CGRect 之类的
253
250
@@ -313,10 +310,19 @@ -(void)modelSetValue:(LKDBProperty *)property value:(id)value
313
310
modelValue = [NSValue valueWithRange: range];
314
311
}
315
312
#endif
313
+ // /如果都没有值 默认给个0
314
+ if (modelValue == nil )
315
+ {
316
+ modelValue = [NSNumber numberWithInt: 0 ];
317
+ }
318
+ }
319
+ else if ([value length ] == 0 )
320
+ {
321
+ // 为了不继续遍历
316
322
}
317
323
else if ([columnClass isSubclassOfClass: [NSString class ]])
318
324
{
319
-
325
+ modelValue = value;
320
326
}
321
327
else if ([columnClass isSubclassOfClass: [NSNumber class ]])
322
328
{
You can’t perform that action at this time.
0 commit comments