Graphics Programs Reference
In-Depth Information
One final note on terminology: in the language of entity-relationship modeling, the attrib-
utes and relationships of an entity are collectively known as its
properties
.
NSManagedObject and subclasses
When an object is fetched with Core Data, its class, by default, is
NSManagedObject
.
NSManagedObject
is a subclass of
NSObject
that knows how to cooperate with the
rest of Core Data. An
NSManagedObject
works a bit like a dictionary: it holds a key-
value pair for every property (attribute or relationship) in the entity.
An
NSManagedObject
is little more than a data container. If you need your model ob-
jects to
do
something in addition to holding data, you must subclass
NSManagedOb-
ject
. Then, in your model file, you specify that this entity is represented by instances of
your subclass, not the standard
NSManagedObject
.
Select the
BNRItem
entity. Show the data model inspector and change the
Class
field to
Data, the type of this object will be
BNRItem
. (
BNRAssetType
instances will still be
of type
NSManagedObject
.)