将核心数据从模拟器移动到设备
首先,我对这个问题表示歉意,因为那里有答案,但由于这是我的第一个项目,我不太明白如何做到这一点的解释。
我有一个使用 Core Data 的应用程序,它可以在模拟器上运行,但当我在设备上生成它时则不能运行。应用程序启动,但核心数据似乎是空的。我想我需要将数据库移至设备中。
有好心人能够以简单的方式解释我如何解决这个问题吗?
问题已解决
我下载了“iPhone Explorer”(http://www.macroplant.com/iphoneexplorer/)并手动删除了实际设备上数据库的两个实例,然后重新运行该应用程序和所有终于成功了。
First i would apologize for the question as there are answers out there but as this is my first project i do not really understand the explanations how to do this.
I have an application that uses Core Data, which works on the simulator but not when i generate it on my device. The app starts but it seems like the Core Data is empty. I guess i need to move the DB into the device.
Would someone nice be able to, in a simple way, explain how I fix this?
PROBLEM SOLVED
I downloaded "iPhone Explorer" (http://www.macroplant.com/iphoneexplorer/) and manually removed the two instances of the DB on the actual device and re-run the app and all finally worked.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您填充 Core Data 生成的 sqlite(位于模拟器文件夹中)并希望添加到项目的主包中以在应用程序启动时加载,请参阅以下网站上的说明:
http://iphonedevelopment.blogspot.com/2010/08/core-data-starting-data.html
这基本上检查预填充的数据库。如果没有找到,它会像第一次启动使用 Core Data 的应用程序时通常所做的那样创建一个。
If you populate the sqlite generated by Core Data (found in the simulator folder) and want to add to the main bundle of your project to load on application startup, then please see the instructions on the following website:
http://iphonedevelopment.blogspot.com/2010/08/core-data-starting-data.html
This basically checks for the pre-populated DB. If not found, it creates one as normally done when on first launch of a application which uses Core Data.