You must check your results. For instance:
FMResultSet *rs = [db executeQuery:@"SELECT * FROM contents WHERE id = 1"];
if (!rs) {
NSLog(@"%s: executeQuery failed: %@", __FUNCTION__, [db lastErrorMessage]);
return;
}
if ([rs next]) {
NSString *title = [rs stringForColumn:@"title"];
NSLog(@"title = %@", title);
} else {
NSLog(@"%s: No record found", __FUNCTION__);
}
[rs close];
You flew blindly if you are not (a) checking the return code executeQuery; and (b) if this did not succeed, see lastErrorMessagethat you know why it did not work.
source
share