简体   繁体   English

在iPhone应用程序重新启动之间未保存sqlite数据

[英]sqlite data is not saved between iPhone app re to launches

When the app is running, I can create tables, insert and retrieve data from and to my sqlite database, but as soon as I relaunch the app, the database is empty again. 当应用程序运行时,我可以创建表,在sqlite数据库中插入数据以及从中检索数据,但是,一旦我重新启动该应用程序,该数据库又将再次为空。 Shouldn't the data be stored, until I specifically say "DROP..." 除非我特别说“ DROP ...”,否则不应该存储数据。

I don't have enough reputation to comment but you don't have a lot of information here. 我没有足够的声誉来发表评论,但您在这里没有太多的信息。 My best guess is that you aren't saving your context which is handled by an instance method of NSManagedObjectContext. 我最好的猜测是您不会保存由NSManagedObjectContext的实例方法处理的上下文。

- (BOOL)save:(NSError **)error;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM