2 lun119 lun119 于 2013.06.17 09:07 提问

删除通话记录中的某一条数据

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; }

1个回答

number1killer
number1killer   2017.08.29 12:20

Why did you use"删除" in chinese but use remove in English but not delete?

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!