Core Data Constants Reference
| Framework | CoreData/CoreData.h |
| Declared in | CoreDataDefines.h CoreDataErrors.h |
Overview
This document describes the constants defined in the Core Data framework and not described in a document for an individual class.
Constants
Error User Info Keys
Keys in the user info dictionary in errors Core Data creates.
const NSString *NSDetailedErrorsKey; const NSString *NSValidationObjectErrorKey; const NSString *NSValidationKeyErrorKey; const NSString *NSValidationPredicateErrorKey; const NSString *NSValidationValueErrorKey; const NSString *NSAffectedStoresErrorKey; const NSString *NSAffectedObjectsErrorKey; const NSString *NSPersistentStoreSaveConflictsErrorKey;
Constants
NSDetailedErrorsKeyIf multiple validation errors occur in one operation, they are collected in an array and added with this key to the “top-level error” of the operation.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationObjectErrorKeyKey for the object that failed to validate for a validation error.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationKeyErrorKeyKey for the key that failed to validate for a validation error.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationPredicateErrorKeyFor predicate-based validation, key for the predicate for the condition that failed to validate.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationValueErrorKeyIf non-nil, the key for the value for the key that failed to validate for a validation error.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSAffectedStoresErrorKeyThe key for stores prompting an error.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSAffectedObjectsErrorKeyThe key for objects prompting an error.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreSaveConflictsErrorKeyThe key for the array of merge conflict objects (instances of
NSMergeConflict).Available in OS X v10.7 and later.
Declared in
CoreDataErrors.h.
Error Domain
Constant to identify the SQLite error domain.
const NSString *NSSQLiteErrorDomain;
Constants
NSSQLiteErrorDomainDomain for SQLite errors.
The value of "code" corresponds to preexisting values in SQLite.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.
Validation Error Codes
Error codes related to validation.
NSManagedObjectValidationError = 1550, NSValidationMultipleErrorsError = 1560, NSValidationMissingMandatoryPropertyError = 1570, NSValidationRelationshipLacksMinimumCountError = 1580, NSValidationRelationshipExceedsMaximumCountError = 1590, NSValidationRelationshipDeniedDeleteError = 1600, NSValidationNumberTooLargeError = 1610, NSValidationNumberTooSmallError = 1620, NSValidationDateTooLateError = 1630, NSValidationDateTooSoonError = 1640, NSValidationInvalidDateError = 1650, NSValidationStringTooLongError = 1660, NSValidationStringTooShortError = 1670, NSValidationStringPatternMatchingError = 1680,
Constants
NSManagedObjectValidationErrorError code to denote a generic validation error.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationMultipleErrorsErrorError code to denote an error containing multiple validation errors.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationMissingMandatoryPropertyErrorError code for a non-optional property with a nil value.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationRelationshipLacksMinimumCountErrorError code to denote a to-many relationship with too few destination objects.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationRelationshipExceedsMaximumCountErrorError code to denote a bounded to-many relationship with too many destination objects.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationRelationshipDeniedDeleteErrorError code to denote some relationship with delete rule
NSDeleteRuleDenyis non-empty.Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationNumberTooLargeErrorError code to denote some numerical value is too large.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationNumberTooSmallErrorError code to denote some numerical value is too small.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationDateTooLateErrorError code to denote some date value is too late.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationDateTooSoonErrorError code to denote some date value is too soon.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationInvalidDateErrorError code to denote some date value fails to match date pattern.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationStringTooLongErrorError code to denote some string value is too long.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationStringTooShortErrorError code to denote some string value is too short.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSValidationStringPatternMatchingErrorError code to denote some string value fails to match some pattern.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.
Discussion
For additional error codes, including NSValidationErrorMinimum and NSValidationErrorMaximum, see NSError.
Object Graph Management Error Codes
These error codes specify Core Data errors related to object graph management.
NSManagedObjectContextLockingError = 132000, NSPersistentStoreCoordinatorLockingError = 132010, NSManagedObjectReferentialIntegrityError = 133000, NSManagedObjectExternalRelationshipError = 133010, NSManagedObjectMergeError = 133020,
Constants
NSManagedObjectContextLockingErrorError code to denote an inability to acquire a lock in a managed object context.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreCoordinatorLockingErrorError code to denote an inability to acquire a lock in a persistent store.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSManagedObjectReferentialIntegrityErrorError code to denote an attempt to fire a fault pointing to an object that does not exist.
The store is accessible, but the object corresponding to the fault cannot be found.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSManagedObjectExternalRelationshipErrorError code to denote that an object being saved has a relationship containing an object from another store.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSManagedObjectMergeErrorError code to denote that a merge policy failed—Core Data is unable to complete merging.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.
Persistent Store Error Codes
Error codes related to persistent stores.
NSPersistentStoreInvalidTypeError = 134000, NSPersistentStoreTypeMismatchError = 134010, NSPersistentStoreIncompatibleSchemaError = 134020, NSPersistentStoreSaveError = 134030, NSPersistentStoreIncompleteSaveError = 134040, NSPersistentStoreSaveConflictsError = 134050, NSPersistentStoreOperationError = 134070, NSPersistentStoreOpenError = 134080, NSPersistentStoreTimeoutError = 134090, NSPersistentStoreIncompatibleVersionHashError = 134100,
Constants
NSPersistentStoreInvalidTypeErrorError code to denote an unknown persistent store type/format/version.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreTypeMismatchErrorError code returned by a persistent store coordinator if a store is accessed that does not match the specified type.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreIncompatibleSchemaErrorError code to denote that a persistent store returned an error for a save operation.
This code pertains to database level errors such as a missing table.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreSaveErrorError code to denote that a persistent store returned an error for a save operation.
This code pertains to errors such as permissions problems.
Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreIncompleteSaveErrorError code to denote that one or more of the stores returned an error during a save operations.
The stores or objects that failed are in the corresponding user info dictionary of the
NSErrorobject.Available in OS X v10.4 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreSaveConflictsErrorError code to denote that an unresolved merge conflict was encountered during a save. .
The
NSErrorobject’s user info dictionary contains the keyNSPersistentStoreSaveConflictsErrorKey.Available in OS X v10.7 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreOperationErrorError code to denote that a persistent store operation failed.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreOpenErrorError code to denote an error occurred while attempting to open a persistent store.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreTimeoutErrorError code to denote that Core Data failed to connect to a persistent store within the time specified by
NSPersistentStoreTimeoutOption.Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreUnsupportedRequestTypeErrorError code to denote that an
NSPersistentStoresubclass was passed a request (an instance ofNSPersistentStoreRequest) that it did not understand.Available in OS X v10.7 and later.
Declared in
CoreDataErrors.h.NSPersistentStoreIncompatibleVersionHashErrorError code to denote that entity version hashes in the store are incompatible with the current managed object model.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.
Migration Error Codes
Error codes related to store migration.
NSMigrationError = 134110, NSMigrationCancelledError = 134120, NSMigrationMissingSourceModelError = 134130, NSMigrationMissingMappingModelError = 134140, NSMigrationManagerSourceStoreError = 134150, NSMigrationManagerDestinationStoreError = 134160, NSEntityMigrationPolicyError = 134170, NSInferredMappingModelError = 134190, NSExternalRecordImportError = 134200,
Constants
NSMigrationErrorError code to denote a general migration error.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSMigrationCancelledErrorError code to denote that migration failed due to manual cancellation.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSMigrationMissingSourceModelErrorError code to denote that migration failed due to a missing source data model.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSMigrationMissingMappingModelErrorError code to denote that migration failed due to a missing mapping model.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSMigrationManagerSourceStoreErrorError code to denote that migration failed due to a problem with the source data store.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSMigrationManagerDestinationStoreErrorError code to denote that migration failed due to a problem with the destination data store.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSEntityMigrationPolicyErrorError code to denote that migration failed during processing of an entity migration policy.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSInferredMappingModelErrorError code to denote a problem with the creation of an inferred mapping model.
Available in OS X v10.6 and later.
Declared in
CoreDataErrors.h.NSExternalRecordImportErrorError code to denote a general error encountered while importing external records.
Available in OS X v10.6 and later.
Declared in
CoreDataErrors.h.
General Error Codes
Error codes that denote a general error.
NSCoreDataError = 134060, NSSQLiteError = 134180,
Constants
NSCoreDataErrorError code to denote a general Core Data error.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.NSSQLiteErrorError code to denote a general SQLite error.
Available in OS X v10.5 and later.
Declared in
CoreDataErrors.h.
Core Data Version Number
Specifies the current Core Data version number.
double NSCoreDataVersionNumber;
Constants
NSCoreDataVersionNumberSpecifies the version of Core Data available in the current process.
Available in OS X v10.4 and later.
Declared in
CoreDataDefines.h.
Discussion
See “Core Data Version Numbers” for defined versions.
Core Data Version Numbers
Specify Core Data version numbers.
#define NSCoreDataVersionNumber10_4 46.0 #define NSCoreDataVersionNumber10_4_3 77.0 #define NSCoreDataVersionNumber10_5 185.0 #define NSCoreDataVersionNumber10_5_3 186.0 #define NSCoreDataVersionNumber10_6 246.0 #define NSCoreDataVersionNumber10_6_2 250.0 #define NSCoreDataVersionNumber10_6_3 251.0 #define NSCoreDataVersionNumber_iOS_3_0 241.0 #define NSCoreDataVersionNumber_iOS_3_1 248.0 #define NSCoreDataVersionNumber_iOS_3_2 310.2 #define NSCoreDataVersionNumber_iPhoneOS_4_0 320.5 #define NSCoreDataVersionNumber_iPhoneOS_4_1 320.11 #define NSCoreDataVersionNumber_iPhoneOS_4_2 320.15
Constants
NSCoreDataVersionNumber10_4Specifies the Core Data version number released with OS X v10.4.0.
Available in OS X v10.5 and later.
Declared in
CoreDataDefines.h.NSCoreDataVersionNumber10_4_3Specifies the Core Data version number released with OS X v10.4.3.
Available in OS X v10.5 and later.
Declared in
CoreDataDefines.h.NSCoreDataVersionNumber10_5Specifies the Core Data version number released with OS X v10.5.0.
Available in OS X v10.6 and later.
Declared in
CoreDataDefines.h.NSCoreDataVersionNumber10_5_3Specifies the Core Data version number released with OS X v10.5.3.
Available in OS X v10.6 and later.
Declared in
CoreDataDefines.h.NSCoreDataVersionNumber10_6Specifies the Core Data version number released with OS X v10.6.0.
Available in OS X v10.7 and later.
Declared in
CoreDataDefines.h.NSCoreDataVersionNumber10_6_2Specifies the Core Data version number released with OS X v10.6.2.
Available in OS X v10.7 and later.
Declared in
CoreDataDefines.h.NSCoreDataVersionNumber10_6_3Specifies the Core Data version number released with OS X v10.6.3.
Available in OS X v10.7 and later.
Declared in
CoreDataDefines.h.NSCoreDataVersionNumber_iOS_3_0Specifies the Core Data version number released with iOS v3.0.
NSCoreDataVersionNumber_iOS_3_1Specifies the Core Data version number released with iOS v3.1.
NSCoreDataVersionNumber_iOS_3_2Specifies the Core Data version number released with iOS v3.2.
NSCoreDataVersionNumber_iPhoneOS_4_0Specifies the Core Data version number released with iOS v4.0.
Available in OS X v10.7 and later.
Declared in
CoreDataDefines.h.NSCoreDataVersionNumber_iPhoneOS_4_1Specifies the Core Data version number released with iOS v4.1.
Available in OS X v10.7 and later.
Declared in
CoreDataDefines.h.NSCoreDataVersionNumber_iPhoneOS_4_2Specifies the Core Data version number released with iOS v4.2.
Available in OS X v10.7 and later.
Declared in
CoreDataDefines.h.
Discussion
See “Core Data Version Number” for the current version.
© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)