虽然我已经链接了sqlite3框架并在我的应用程序委托文件中包含了标头,但是Xcode想要改变:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
if ([MyDatabase database]) sqlite3_close([MyDatabase database]);
}
到此:
- (void)applicationDidEnterBackground:(UIApplication *)application
{
if ([MyDatabase database]) sqlite3_close((__bridge sqlite3 *)([MyDatabase database]));
}
在上面的代码中,database是对MyDatabase实例的单例引用,该实例适用于该程序的所有其他方面。