在我的应用程序中,我正在使用FMDatabase.我正在尝试向该列添加新column的现有数据,table然后添加insert数据.当我添加列时Alter Table,我没有错误,但是当我尝试在表中插入数据时,我收到错误抱怨新添加的列不存在.
这是我的代码
NSString *databasePath = [myDB getPlacesDBPath];
FMDatabase *db = [FMDatabase databaseWithPath:databasePath];
if (![db open])
{
return ;
}
if (![db columnExists:@"placeName" inTableWithName:@"MYPLACES"])
{
[db executeQuery:@"ALTER TABLE MYPLACES ADD COLUMN placeName TEXT"];
// I tried to set the result of this query in "BOOL Success" and print the results and I got YES
}
//Note: I have more than 12 columns but I didn't post all of them here …Run Code Online (Sandbox Code Playgroud) 在我搬到之后iOS 7 / xcode 5,border尽管我处理了这个案例,但隐藏的部分仍然出现了iOS 6,它对我有用.
在我的代码中,我正在使用它来section隐藏边框,它可以工作iOS 6但不能工作iOS 7:
cell.backgroundView =[[UIView alloc] initWithFrame:CGRectZero];
Run Code Online (Sandbox Code Playgroud)
请指教.