将Core Data添加到现有的iPhone应用程序 [英] Adding Core Data to an existing iPhone app
问题描述
我开始了我的应用程序,现在我想将Core Data添加到我的应用程序。如何添加?
I have started my application and now I want to add Core Data to my app. How can I add it?
推荐答案
我不同意你必须开始一个新项目。将CoreData集成到现有项目中实际上是很容易的 - 一个很好的起点是创建一个新的CoreData项目,但将它生成的代码复制到现有项目中(仔细检查应用程序委托以查看其设置)。这真的没有那么多的代码,很容易创建新的数据模型。
I disagree that you have to start a new project. It's actually pretty easy to integrate CoreData into an existing project - a good starting point is to create a new CoreData project, but copy the code it generates into your existing project (examine carefully the app delegate to see what it sets up). There's really not that much code involved, and it's easy to create new data models.
这也是一个很好的主意,通过苹果的CoreData教程,了解发生了什么,还有一些好书。
It's also a really good idea to work through Apple's CoreData tutorials to understand what is going on, and there are some good books as well.
这篇关于将Core Data添加到现有的iPhone应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!