简体   繁体   English

无法更新主捆绑包中的文件

[英]Trouble updating file in main bundle

I have a weird problem. 我有一个奇怪的问题。 I have a database in main bundle in my app. 我的应用程序中的main bundle中有一个database When the app launches it checks whether there is a database in documents directory. 应用启动时,它会检查文档目录中是否有数据库。 If not, then it copies there from bundle. 如果不是,那么它将从捆绑软件复制到那里。 Everything was Working before I update Xcode . update Xcode之前,一切正常。 Now, when I try to delete an old database from bundle and to put the new one, it still copies the old. 现在,当我尝试从捆绑软件中删除旧数据库并放入新数据库时,它仍会复制旧数据库。 Eventhough I've put it into trash and cleaned trash. 尽管我已将其放入垃圾桶并清洁了垃圾桶。 Can anyone suggest a solution? 谁能提出解决方案? Because I'm a bit confused with it. 因为我对此有些困惑。

I tried some way and I found out that when I add a new file to the project - it just doesn't add there... Though in Xcode I see it in bundle.... 我尝试了一些方法,发现当我将新文件添加到项目中时-它只是没有添加到项目中。尽管在Xcode中,我还是将其捆绑在一起。

You should remove the application from simulator or device. 您应该从模拟器或设备中删除该应用程序。 Your application in the simulator has already copied the database from main bundle to documents directory. 您在模拟器中的应用程序已将数据库从主捆绑包复制到文档目录。

So, if you will reinstall the app, your new database will be installed. 因此,如果您将重新安装该应用程序,则将安装新数据库。

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

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