- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
似乎 NSEntityDescription
对象描述数据,而 NSManagedObject
对象包含相应的数据。如果您有一个普通的 NSObject 子类,那么数据的描述和实际数据位于同一位置,不是吗?好吧,至少描述在类中,数据在对象中。您可以将对象视为具有对其所包含变量类型的描述。
为什么 Core Data 将描述数据的类和包含数据的类分开呢?与错误有关吗?
最佳答案
If you have a normal NSObject subclass, the description of the data and the actual data are in the same place, aren't they.
没有。类是对象的描述,实例是对象(包括其数据。
Why then does Core Data separate the class which describes the data and the class which contains the data? Is it to do with faulting?
不,这是因为模型的描述与符合模型的数据的实例化本质上是不同的。这是计算中的标准事物,例如对于 SQL 数据库,数据的描述(DDL)不是数据(实际的数据库)。对于 XML,描述(架构或 DTD)不是实际的 XML 数据。
关于iphone - 为什么 NSManagedObject 和 NSEntityDescription 是单独的类?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5483003/
我自学了 Obj-C,并且一直在自学 Cocoa,但是将 Core Data 添加到我的程序中却让我非常头疼,因为我需要大量的自定义逻辑。以下是几个让我抓狂的问题。 如果我希望一个托管对象拥有另一个托
我正在创建一个新的 NSManagedObject 并尝试与另一个 NSManagedObject 建立关系,但收到此错误: Illegal attempt to establish a relati
我有一个 NSManagedObject 派生类 OrderMO,它具有 NSDate 类型的属性 OrderDate。我希望 OrderDate 的默认值是尚无关联订单的第一个月的第一个星期一。 为
我正在尝试使用我在该网站上找到的一个与使用 TableView 中的滑动功能从核心数据中删除相关的功能,但我无法弄清楚此错误消息需要我做什么?有人可以帮忙解决这个错误吗? import UIKit i
我正在创建一个名为“translation”的新 NSManagedObject。在翻译中,我需要创建两个额外的 NSManagedObjects 称为“phrase”。有时,其中一个短语分配会引发错
到目前为止,我已经在这个问题上花费了 6 个多小时,确实需要帮助。我编译的 RKCatalog 示例很好。但是当我尝试将示例包含到我的独立项目中时,我遇到了各种问题: 当我从我的主项目运行这个例子时,
我已经将一个 NSManagedObject 对象复制到一个临时的 NSManagedObject 对象中。这样,如果用户输入没有变化,我就可以使用那个临时的 NSManagedObject 对象。否
我正在使用 CoreData 开发 Objective-C,但出现以下错误... *** Terminating app due to uncaught exception 'NSInvalidArg
我正在为我的 iPhone 应用程序使用核心数据模型。我一直在寻找一种在 ManagedObjectContext 之外实例化或使用实体的方法。 (我知道这是不应该做的,我也更多地寻找一种不这样做的方
我正在与 CoreData 作斗争。我想获取以下对象: @interface Email : NSManagedObject { } @property (nonatomic, copy) NSStr
是否可以使用 NSFetchedResultsController 设置一个 UITableView,因为它是 dataSource,其中 Contact Group 决定了部分, Contact G
我正在尝试将对象添加到“一对一”关系中: //1. I create the temporary object for the ServerUpdates entity NSManagedObject
我有一个作者实体。 Author 实体在其 Class 定义中具有一组 Book 实体作为 1:many 关系。 Author 目前不在 managedObjectContext 中。 当我说 [se
这个问题已经存在: Must have a valid NSEntityDescription Objective c? 4年前关闭。 我在核心数据 x code8.3 中遇到错误,数据库已添加 DB
我想观察特定 NSManagedObject 的变化并相应地更新 UI。 我不想保留对NSManagedObject 的引用,因为它可能随时被删除(即通过远程推送通知的结果)。 目前我正在设置 NSF
我正在使用核心数据在 vc1 中保存一个类别,并想将列表属性添加到 vc2 中的列表中。我的数据模型是许多列表属性的一个类别。 我在 vc1 中添加这样的类别: func createNewCateg
我已将 RestKit 链接到一个 xcode 4 项目中,如 GitHub 安装页面所述,但在尝试构建时遇到此错误。有谁知道发生了什么事?我也在 RestKit IRC channel 上提问,正在
首先让我确保我有 X-Code 4.3.2 版本和 iOS 5.1 SDK。我在我的项目中使用以下方法进行核心数据操作。两种方法都会发出相同的警告。即“从结果类型为“NSManagedObject ”
我为我的 Story 模型创建了 NSManagedObject 的子类。我创建了几个新故事,如下所示: Story *newStory = [NSEntityDescription insertNe
我正在努力使我的 NSMangedObjectClass 配置文件可导出/可导出。 我试试this way 如果我在 NSArrays 中写入关系,则导出工作正常,因为 NSSet 没有 writeT
我是一名优秀的程序员,十分优秀!