源链接: http://blog.csdn.net/iunion/article/details/7091744
- (BOOL) isTableOK:(NSString *)tableName
{
FMResultSet *rs = [self.DB executeQuery:@"select count(*) as 'count' from sqlite_master where type ='table' and name = ?", tableName];
while ([rs next])
{
// just print out what we've got in a number of formats.
NSInteger count = [rs intForColumn:@"count"];
NSLog(@"isTableOK %d", count);
if (0 == count)
{
return NO;
}
else
{
return YES;
}
}
return NO;
}