以下是我正在使用的代码:
FMDatabaseQueue *queue = [[DataBaseHelper sharedManager] queue];
[queue inDatabase:^(FMDatabase *db) {
FMResultSet *results = [db executeQuery:@"select * from EVENT where ESTATUS='unread' and HIT_ATTEMPTS < 5 "];
if([results next])
{
[results close];
@try {
BOOL success=FALSE;
NSString *query=[NSString stringWithFormat:@"insert into EVENT (EDATA, ESTATUS ,EUSER) values('%@','%@','%@')",@"google.com",@"unread",@"xyz"];
success = [db executeUpdate:query];
NSLog(@"create edata row, %d:%@", [db lastErrorCode], [db lastErrorMessage]);
}
@catch (NSException *exception) {
NSLog(@"Exception");
}
在上面的代码中success = [db executeUpdate:query]; 不管用。我试过放置断点。这行代码后全部退出。没有任何日志被打印。