如何将Core数据添加到现有实用程序应用程序

如何将Core数据添加到现有实用程序应用程序

本文介绍了如何将Core数据添加到现有实用程序应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个几乎完成的实用程序应用程序,但现在我的一点是我真的要保留数据。



由于XCode仅提供在导航或基于窗口的应用程序中的核心数据模板,有一个简单的方法来添加核心数据到我的应用程序?我从来没有使用Core Data,只需要坚持使用460个字符的消息和一个联系人姓名tp它作为发送消息的历史。



或者我应该从基于窗口的新应用程序核心数据,并尝试手动构建的实用程序/ Flipside零件?



有人可以建议我最好的做法,我的情况吗?

NSManagedObjectModel , NSPersistentStoreCoordinator NSManagedObjectContext 对象。



现有应用程序中的数据将在中简要讨论(搜索现有应用程序)



您还应该查看Apple 来获得所涉及的内容。



您始终可以考虑只使用SQLite。


I´ve created an utility Application which is nearly complete, but now I´m on a point were I really have to persist Data.

Since XCode provides only Core Data Templates in an Navigation or Window Based App, is there an easy way to add Core Data to my Application? I´ve never worked with Core Data and just have to persist messages with 460 Characters and a contact Name tp it as a history of send Messages.

Or should I start with a new Window Based Application incl. Core Data and try to build the Utility / Flipside Part by hand?

Can someone suggest me the best practice for my situation?

解决方案

You'll need to add the CoreData framework to your target, create a data model, and instantiate the NSManagedObjectModel, NSPersistentStoreCoordinator, and NSManagedObjectContext objects.

Adding Core Data to an existing application is discussed briefly in this Apple document (search for "existing application")

You should also view the Apple tutorial to get a feel for what is involved.

You can always consider just using SQLite as well.

这篇关于如何将Core数据添加到现有实用程序应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 11:15