Core Data Model

Describe your app’s object structure.

Overview

In most cases, you describe your app’s data model using Xcode’s data model editor. NSManagedObjectModel represents the .xcdatamodeld file in your project’s source list. This is where you define entities that you use to generate NSManagedObject subclasses for Core Data to manage.

The entities you create are NSEntityDescription instances. Entities’ properties are subclasses of NSPropertyDescription, namely NSAttributeDescription for attributes, NSRelationshipDescription for relationships, and NSFetchedPropertyDescription for fetched properties.

The various attribute types are enumerated in NSAttributeType.

Topics

Managed Objects and Entities

NSManagedObject

A base class that implements the behavior required of a Core Data model object.

NSEntityDescription

A description of an entity in Core Data.

Attributes and Relationships

NSPropertyDescription

A description of a property of a Core Data entity.

NSAttributeDescription

A description of an attribute of a Core Data entity.

NSAttributeType

The possible types of Core Data attributes.

NSDerivedAttributeDescription

A description of an attribute of a Core Data entity that derives its value from one or more other properties.

NSRelationshipDescription

A description of a relationship of a Core Data entity.

Fetched Properties

NSFetchedPropertyDescription

A description object used to define which properties are fetched from Core Data.

See Also

Data Modeling

Modeling Data

Configure the data model file to contain your app’s object graph.