Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道如果我对我的应用程序进行更新,如果用户里面有东西,它会覆盖核心数据数据库还是只是将数据库保留在那里?我想确保它不会删除用户保存的任何内容。我必须复制它还是将其单独留在更新中?
在您的代码中检查以下调用(对 NSPersistentStoreCoordinator):
addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error]
如果上述调用中的 storeURL 指向 Document 目录中的文件(它应该指向该文件),则升级不会触及您的数据库。
我在我的应用程序中有一个 UIWebView,在该 Web 视图中,我导航到我的移动网站,其中有一个按钮输入,类型为“选择文件”,用于加载新的个人资料图片。每次我尝试从生成的上拉 iPhone 菜单中选择“选择现有”或“拍照”选项时,当我的视图控制器消失以允许我选择照片时,我都会收到以下错误:
“对 U