File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -403,7 +403,7 @@ - (BOOL)deleteObject:(id)object {
403
403
// 获取类的属性和sql类型
404
404
NSDictionary * propertsDict = [GKObjcProperty getSQLProperties: [object class ]];
405
405
// 拼接字符串
406
- NSMutableString * sqlString = [NSMutableString stringWithFormat: @" delete from %@ where " ,[object class ] ];
406
+ NSMutableString * sqlString = [NSMutableString string ];
407
407
[propertsDict enumerateKeysAndObjectsUsingBlock: ^(id _Nonnull key, id _Nonnull value, BOOL * _Nonnull stop) {
408
408
if ([value isEqualToString: @" integer" ] || [value isEqualToString: @" real" ]) {
409
409
[sqlString appendFormat: @" %@ = %@ and" ,key , [object valueForKey: key]];
@@ -414,8 +414,10 @@ - (BOOL)deleteObject:(id)object {
414
414
// 删除最后多余的and
415
415
NSRange rang = NSMakeRange (sqlString.length -@" and" .length -1 , @" and" .length +1 );
416
416
[sqlString deleteCharactersInRange: rang];
417
- return [self executeSqlString: sqlString];
417
+
418
+ return [self deleteObject: [object class ] withString: sqlString];
418
419
}
420
+
419
421
// / 数据删除
420
422
- (BOOL )deleteObject : (Class )className withString : (NSString *)string {
421
423
// 判断数据库有没有打开
You can’t perform that action at this time.
0 commit comments