I want to remove callhistory article call one of the data in the database, the database is read-only, how should do?
Code:
//获取数据库 FMDatabase * db = [dataManager openDataBase]; //判断数据库是否能打开 if ([db open]) { //获取通话记录中所有的address FMResultSet * rs = [db executeQuery:@"SELECT address FROM privacy_call"]; NSString * markaddress = nil; while ([rs next]) { NSString * address = [rs stringForColumn:@"address"]; if ([self isEqualContactNumber:address withPrivacyNumber:number] && ![markaddress isEqualToString:address]) { markaddress = address; //删除数据 BOOL resultSet = [db executeUpdate:@"DELETE FROM privacy_call WHERE address = ?",address]; success = resultSet; } } [rs close]; } else { NSLog(@"数据库打开错误"); return NO; }
删除通话记录中的某一条数据
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答
- number1killer 2017-08-29 04:20关注
Why did you use"删除" in chinese but use remove in English but not delete?
解决 无用评论 打赏 举报