FMDB 使用技巧

 

源链接:  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;
}

posted @ 2014-12-09 09:10  采采00  阅读(145)  评论(0编辑  收藏  举报