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.
我使用核心数据开发了我的应用程序。它在模拟器中运行良好。当我将它部署到设备时,数据库是空的。应该是 484k 的地方是 49k。
基本上它没有填充。由于在应用程序运行时我不写入数据库,因此我需要向应用程序提供填充的数据库。所以我将填充的数据库从模拟器复制到资源,然后部署。
仍然没有运气。填充的数据库位于 MyApp.app 中,并且 AppDelegate 正在从 Documents 目录中读取。如何在文档目录中获取它或让应用程序委托在应用程序中查看?
提前致谢,
安德鲁
看看这个问题:有什么 方法可以预先填充核心数据?