Mac Developer Library

Developer

CoreData Framework Reference NSManagedObjectModel Class Reference

Options
Deployment Target:

On This Page
Language:

NSManagedObjectModel

An NSManagedObjectModel object describes a schema—a collection of entities (data models) that you use in your application. More...

Inheritance


Import Statement


import CoreData @import CoreData;

Availability


Available in OS X v10.4 and later.
  • The localization dictionary of the receiver.

    Declaration

    Swift

    var localizationDictionary: [NSObject : AnyObject]?

    Objective-C

    @property(strong) NSDictionary *localizationDictionary

    Discussion

    Table 1 describes the key and value pattern for the localization dictionary.

    Table 1Key and value pattern for the localization dictionary.

    Key

    Value

    Note

    "Entity/NonLocalizedEntityName"

    "LocalizedEntityName"

    "Property/NonLocalizedPropertyName/Entity/EntityName"

    "LocalizedPropertyName"

    (1)

    "Property/NonLocalizedPropertyName"

    "LocalizedPropertyName"

    "ErrorString/NonLocalizedErrorString"

    "LocalizedErrorString"

    (1) For properties in different entities with the same non-localized name but that should have different localized names.

    Special Considerations

    On OS X v10.4, localizationDictionary may return nil until Core Data lazily loads the dictionary for its own purposes (for example, reporting a localized error).

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.4 and later.

  • Returns a Boolean value that indicates whether a given configuration in the receiver is compatible with given metadata from a persistent store.

    Declaration

    Swift

    func isConfiguration(_ configuration: String?, compatibleWithStoreMetadata metadata: [NSObject : AnyObject]?) -> Bool

    Objective-C

    - (BOOL)isConfiguration:(NSString *)configuration compatibleWithStoreMetadata:(NSDictionary *)metadata

    Parameters

    configuration

    The name of a configuration in the receiver. Pass nil to specify no configuration.

    metadata

    Metadata for a persistent store.

    Return Value

    YEStrue if the configuration in the receiver specified by configuration is compatible with the store metadata given by metadata, otherwise NOfalse.

    Discussion

    This method compares the version information in the store metadata with the entity versions of a given configuration. For information on specific differences, use entityVersionHashesByName and perform an entity-by-entity comparison.

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.5 and later.

  • A dictionary of the version hashes for the entities in the receiver, keyed by entity name. (read-only)

    Declaration

    Swift

    var entityVersionHashesByName: [NSObject : AnyObject] { get }

    Objective-C

    @property(readonly, copy) NSDictionary *entityVersionHashesByName

    Discussion

    The dictionary of version hash information is used by Core Data to determine schema compatibility.

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.5 and later.

  • The set of developer-defined version identifiers for the receiver.

    Declaration

    Swift

    @NSCopying var versionIdentifiers: NSSet

    Objective-C

    @property(copy) NSSet *versionIdentifiers

    Discussion

    Merged models return the combined collection of identifiers. The Core Data framework does not give models a default identifier, nor does it depend this value at runtime. For models created in Xcode, you set this value in the model inspector.

    This value is meant to be used as a debugging hint to help you determine the models that were combined to create a merged model.

    Import Statement

    import CoreData

    Availability

    Available in OS X v10.5 and later.