NSString *sql = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS '%@' ('%@' TEXT PRIMARY KEY, '%@' TEXT);", tableName, field1, field2];
I faced quite a lot of problems开发者_如何学Go with this line of programming, can anyone help me solve the problem? I'm new to Xcode. Thanks! :)
Try without the single quotes
SString *sql = [NSString stringWithFormat:@"CREATE TABLE IF NOT EXISTS %@ (%@ TEXT PRIMARY KEY, %@ TEXT);", tableName, field1, field2];
精彩评论