xcode 将核心数据添加到我的 iPhone 应用程序

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1190139/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 18:42:18  来源:igfitidea点击:

Adding core data to my iPhone app

iphonexcodecore-data

提问by mslot

I have been here before, asking for a mapping library that could store objects in a database. Some one told me about the Core Data Framework. I have read a bit about it and I kindda understand it. I have created some "test Core data projects", where I have worked with simple problems and models ala Person and Group. But now I want to experiment with implementing Core Data to one of my small iPhone apps. How do I do this? Subclassing from NSManagedObject and make a Managed Object Model? I know that there is more to it, but I havent found anything on google og apples site. Maybe Im looking in wrong direction while googling and searching. A link to an article/tutorial explaining me how to add Core Data to my project would make my day.

我以前来过这里,要求一个可以在数据库中存储对象的映射库。有人告诉我关于核心数据框架。我已经阅读了一些关于它的内容,我有点理解它。我创建了一些“测试核心数据项目”,在那里我处理了简单的问题和模型 ala Person 和 Group。但现在我想尝试将 Core Data 实施到我的一个小型 iPhone 应用程序中。我该怎么做呢?从 NSManagedObject 子类化并创建托管对象模型?我知道还有更多内容,但我没有在 google og apples 网站上找到任何内容。也许我在谷歌搜索和搜索时看错了方向。一个解释我如何将 Core Data 添加到我的项目的文章/教程的链接会让我开心。

回答by willi

There's a tutorial on iPhone developer site here. And there are several sample codeswith Core Data as well. These should get you started.

iPhone 开发者网站上有一个教程here。还有一些带有 Core Data 的示例代码。这些应该让你开始。

回答by Rose Perrone

The book, More iPhone 3 Developmentbegins with a great tutorial demonstrating how to use Core Data. I've found it incredibly helpful.

更多 iPhone 3 开发》一书以演示如何使用 Core Data 的精彩教程开始。我发现它非常有帮助。

回答by Richard Stelling

Here is a basic CoreData screencastthat, while not specifically for the iPhone gives a decent introduction to CoreData concepts.

这是一个基本的CoreData 截屏视频,虽然不是专门针对 iPhone 的,但它很好地介绍了 CoreData 概念。