Documentation Archive Developer
Search

CoreData Changes for Objective-C

CoreData

CoreDataDefines.h

CoreDataErrors.h

NSAtomicStore.h

Declaration
From
- (void)addCacheNodes:(NSSet *)cacheNodes
To
- (void)addCacheNodes:(NSSet<__kindof NSAtomicStoreCacheNode *> * _Nonnull)cacheNodes

Declaration
From
- (NSSet *)cacheNodes
To
- (NSSet<__kindof NSAtomicStoreCacheNode *> * _Nonnull)cacheNodes

Declaration
From
- (void)willRemoveCacheNodes:(NSSet *)cacheNodes
To
- (void)willRemoveCacheNodes:(NSSet<__kindof NSAtomicStoreCacheNode *> * _Nonnull)cacheNodes

NSAtomicStoreCacheNode.h

Declaration
From
@property(nonatomic, strong) NSMutableDictionary *propertyCache
To
@property(nonatomic, strong, nullable) NSMutableDictionary<NSString *,id> *propertyCache

NSBatchDeleteRequest.h (Added)

NSEntityDescription.h

Declaration
From
@property(readonly, copy) NSDictionary *attributesByName
To
@property(readonly, copy, nonnull) NSDictionary<NSString *,NSAttributeDescription *> *attributesByName

Declaration
From
@property(strong) NSArray *compoundIndexes
To
@property(strong, nonnull) NSArray<NSArray<id> *> *compoundIndexes

Declaration
From
+ (id)insertNewObjectForEntityForName:(NSString *)entityName inManagedObjectContext:(NSManagedObjectContext *)context
To
+ (__kindof NSManagedObject * _Nonnull)insertNewObjectForEntityForName:(NSString * _Nonnull)entityName inManagedObjectContext:(NSManagedObjectContext * _Nonnull)context

Declaration
From
@property(strong) NSArray *properties
To
@property(strong, nonnull) NSArray<__kindof NSPropertyDescription *> *properties

Declaration
From
@property(readonly, copy) NSDictionary *propertiesByName
To
@property(readonly, copy, nonnull) NSDictionary<NSString *,__kindof NSPropertyDescription *> *propertiesByName

Declaration
From
@property(readonly, copy) NSDictionary *relationshipsByName
To
@property(readonly, copy, nonnull) NSDictionary<NSString *,NSRelationshipDescription *> *relationshipsByName

Declaration
From
- (NSArray *)relationshipsWithDestinationEntity:(NSEntityDescription *)entity
To
- (NSArray<NSRelationshipDescription *> * _Nonnull)relationshipsWithDestinationEntity:(NSEntityDescription * _Nonnull)entity

Declaration
From
@property(strong) NSArray *subentities
To
@property(strong, nonnull) NSArray<NSEntityDescription *> *subentities

Declaration
From
@property(readonly, copy) NSDictionary *subentitiesByName
To
@property(readonly, copy, nonnull) NSDictionary<NSString *,NSEntityDescription *> *subentitiesByName

NSEntityMapping.h

Declaration
From
@property(strong) NSArray *attributeMappings
To
@property(strong, nullable) NSArray<NSPropertyMapping *> *attributeMappings

Declaration
From
@property(strong) NSArray *relationshipMappings
To
@property(strong, nullable) NSArray<NSPropertyMapping *> *relationshipMappings

NSFetchedResultsController.h

Declaration
From
- (id)initWithFetchRequest:(NSFetchRequest *)fetchRequest managedObjectContext:(NSManagedObjectContext *)context sectionNameKeyPath:(NSString *)sectionNameKeyPath cacheName:(NSString *)name
To
- (instancetype _Nonnull)initWithFetchRequest:(NSFetchRequest * _Nonnull)fetchRequest managedObjectContext:(NSManagedObjectContext * _Nonnull)context sectionNameKeyPath:(NSString * _Nullable)sectionNameKeyPath cacheName:(NSString * _Nullable)name

Declaration
From
@property(nonatomic, readonly) NSArray *sectionIndexTitles
To
@property(nonatomic, readonly, nonnull) NSArray<NSString *> *sectionIndexTitles

Declaration
From
@property(nonatomic, readonly) NSArray *sections
To
@property(nonatomic, readonly, nullable) NSArray<id<NSFetchedResultsSectionInfo>> *sections

Protocols
From--
ToNSObject

NSFetchRequest.h

Declaration
From
@property(nonatomic, strong) NSArray *affectedStores
To
@property(nonatomic, strong, nullable) NSArray<NSPersistentStore *> *affectedStores

Declaration
From
@property(nonatomic, copy) NSArray *relationshipKeyPathsForPrefetching
To
@property(nonatomic, copy, nullable) NSArray<NSString *> *relationshipKeyPathsForPrefetching

Declaration
From
@property(nonatomic, strong) NSArray *sortDescriptors
To
@property(nonatomic, strong, nullable) NSArray<NSSortDescriptor *> *sortDescriptors

NSFetchRequestExpression.h

Removed NSFetchRequestExpressionType

NSIncrementalStore.h

Declaration
From
- (void)managedObjectContextDidRegisterObjectsWithIDs:(NSArray *)objectIDs
To
- (void)managedObjectContextDidRegisterObjectsWithIDs:(NSArray<NSManagedObjectID *> * _Nonnull)objectIDs

Declaration
From
- (void)managedObjectContextDidUnregisterObjectsWithIDs:(NSArray *)objectIDs
To
- (void)managedObjectContextDidUnregisterObjectsWithIDs:(NSArray<NSManagedObjectID *> * _Nonnull)objectIDs

Declaration
From
- (NSArray *)obtainPermanentIDsForObjects:(NSArray *)array error:(NSError **)error
To
- (NSArray<NSManagedObjectID *> * _Nullable)obtainPermanentIDsForObjects:(NSArray<NSManagedObject *> * _Nonnull)array error:(NSError * _Nullable * _Nullable)error

NSIncrementalStoreNode.h

Declaration
From
- (instancetype)initWithObjectID:(NSManagedObjectID *)objectID withValues:(NSDictionary *)values version:(uint64_t)version
To
- (instancetype _Nonnull)initWithObjectID:(NSManagedObjectID * _Nonnull)objectID withValues:(NSDictionary<NSString *,id> * _Nonnull)values version:(uint64_t)version

Declaration
From
- (void)updateWithValues:(NSDictionary *)values version:(uint64_t)version
To
- (void)updateWithValues:(NSDictionary<NSString *,id> * _Nonnull)values version:(uint64_t)version

NSManagedObject.h

Declaration
From
- (NSDictionary *)changedValues
To
- (NSDictionary<NSString *,id> * _Nonnull)changedValues

Declaration
From
- (NSDictionary *)changedValuesForCurrentEvent
To
- (NSDictionary<NSString *,id> * _Nonnull)changedValuesForCurrentEvent

Declaration
From
- (NSDictionary *)committedValuesForKeys:(NSArray *)keys
To
- (NSDictionary<NSString *,id> * _Nonnull)committedValuesForKeys:(NSArray<NSString *> * _Nullable)keys

Declaration
From
- (instancetype)initWithEntity:(NSEntityDescription *)entity insertIntoManagedObjectContext:(NSManagedObjectContext *)context
To
- (__kindof NSManagedObject * _Nonnull)initWithEntity:(NSEntityDescription * _Nonnull)entity insertIntoManagedObjectContext:(NSManagedObjectContext * _Nullable)context

NSManagedObjectContext.h

Declaration
From
@property(nonatomic, readonly, strong) NSSet *deletedObjects
To
@property(nonatomic, readonly, strong, nonnull) NSSet<__kindof NSManagedObject *> *deletedObjects

Declaration
From
- (NSPersistentStoreResult *)executeRequest:(NSPersistentStoreRequest *)request error:(NSError **)error
To
- (__kindof NSPersistentStoreResult * _Nullable)executeRequest:(NSPersistentStoreRequest * _Nonnull)request error:(NSError * _Nullable * _Nullable)error

Declaration
From
- (NSManagedObject *)existingObjectWithID:(NSManagedObjectID *)objectID error:(NSError **)error
To
- (__kindof NSManagedObject * _Nullable)existingObjectWithID:(NSManagedObjectID * _Nonnull)objectID error:(NSError * _Nullable * _Nullable)error

IntroductionDeprecation
FromiOS 8.0--
ToiOS 3.0iOS 9.0

Declaration
From
@property(nonatomic, readonly, strong) NSSet *insertedObjects
To
@property(nonatomic, readonly, strong, nonnull) NSSet<__kindof NSManagedObject *> *insertedObjects

Declaration
From
- (NSManagedObject *)objectRegisteredForID:(NSManagedObjectID *)objectID
To
- (__kindof NSManagedObject * _Nullable)objectRegisteredForID:(NSManagedObjectID * _Nonnull)objectID

Declaration
From
- (NSManagedObject *)objectWithID:(NSManagedObjectID *)objectID
To
- (__kindof NSManagedObject * _Nonnull)objectWithID:(NSManagedObjectID * _Nonnull)objectID

Declaration
From
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
To
- (void)observeValueForKeyPath:(NSString * _Nullable)keyPath ofObject:(id _Nullable)object change:(NSDictionary<NSString *,id> * _Nullable)change context:(void * _Nullable)context

Declaration
From
- (BOOL)obtainPermanentIDsForObjects:(NSArray *)objects error:(NSError **)error
To
- (BOOL)obtainPermanentIDsForObjects:(NSArray<NSManagedObject *> * _Nonnull)objects error:(NSError * _Nullable * _Nullable)error

Declaration
From
@property(nonatomic, readonly, strong) NSSet *registeredObjects
To
@property(nonatomic, readonly, strong, nonnull) NSSet<__kindof NSManagedObject *> *registeredObjects

Declaration
From
@property(nonatomic, readonly, strong) NSSet *updatedObjects
To
@property(nonatomic, readonly, strong, nonnull) NSSet<__kindof NSManagedObject *> *updatedObjects

IntroductionDeprecation
FromiOS 5.0--
ToiOS 3.0iOS 9.0

NSManagedObjectModel.h

Declaration
From
@property(readonly, strong) NSArray *configurations
To
@property(readonly, strong, nonnull) NSArray<NSString *> *configurations

Declaration
From
@property(strong) NSArray *entities
To
@property(strong, nonnull) NSArray<NSEntityDescription *> *entities

Declaration
From
@property(readonly, copy) NSDictionary *entitiesByName
To
@property(readonly, copy, nonnull) NSDictionary<NSString *,NSEntityDescription *> *entitiesByName

Declaration
From
- (NSArray *)entitiesForConfiguration:(NSString *)configuration
To
- (NSArray<NSEntityDescription *> * _Nullable)entitiesForConfiguration:(NSString * _Nullable)configuration

Declaration
From
@property(readonly, copy) NSDictionary *entityVersionHashesByName
To
@property(readonly, copy, nonnull) NSDictionary<NSString *,NSData *> *entityVersionHashesByName

Declaration
From
- (NSFetchRequest *)fetchRequestFromTemplateWithName:(NSString *)name substitutionVariables:(NSDictionary *)variables
To
- (NSFetchRequest * _Nullable)fetchRequestFromTemplateWithName:(NSString * _Nonnull)name substitutionVariables:(NSDictionary<NSString *,id> * _Nonnull)variables

Declaration
From
@property(readonly, copy) NSDictionary *fetchRequestTemplatesByName
To
@property(readonly, copy, nonnull) NSDictionary<NSString *,NSFetchRequest *> *fetchRequestTemplatesByName

Declaration
From
- (BOOL)isConfiguration:(NSString *)configuration compatibleWithStoreMetadata:(NSDictionary *)metadata
To
- (BOOL)isConfiguration:(NSString * _Nullable)configuration compatibleWithStoreMetadata:(NSDictionary<NSString *,id> * _Nonnull)metadata

Declaration
From
@property(strong) NSDictionary *localizationDictionary
To
@property(strong, nullable) NSDictionary<NSString *,NSString *> *localizationDictionary

Declaration
From
+ (NSManagedObjectModel *)mergedModelFromBundles:(NSArray *)bundles
To
+ (NSManagedObjectModel * _Nullable)mergedModelFromBundles:(NSArray<NSBundle *> * _Nullable)bundles

Declaration
From
+ (NSManagedObjectModel *)mergedModelFromBundles:(NSArray *)bundles forStoreMetadata:(NSDictionary *)metadata
To
+ (NSManagedObjectModel * _Nullable)mergedModelFromBundles:(NSArray<NSBundle *> * _Nullable)bundles forStoreMetadata:(NSDictionary<NSString *,id> * _Nonnull)metadata

Declaration
From
+ (NSManagedObjectModel *)modelByMergingModels:(NSArray *)models
To
+ (NSManagedObjectModel * _Nullable)modelByMergingModels:(NSArray<NSManagedObjectModel *> * _Nullable)models

Declaration
From
+ (NSManagedObjectModel *)modelByMergingModels:(NSArray *)models forStoreMetadata:(NSDictionary *)metadata
To
+ (NSManagedObjectModel * _Nullable)modelByMergingModels:(NSArray<NSManagedObjectModel *> * _Nonnull)models forStoreMetadata:(NSDictionary<NSString *,id> * _Nonnull)metadata

Declaration
From
- (void)setEntities:(NSArray *)entities forConfiguration:(NSString *)configuration
To
- (void)setEntities:(NSArray<NSEntityDescription *> * _Nonnull)entities forConfiguration:(NSString * _Nonnull)configuration

NSMappingModel.h

Declaration
From
@property(strong) NSArray *entityMappings
To
@property(strong) NSArray<NSEntityMapping *> * _Null_unspecified entityMappings

Declaration
From
@property(readonly, copy) NSDictionary *entityMappingsByName
To
@property(readonly, copy, nonnull) NSDictionary<NSString *,NSEntityMapping *> *entityMappingsByName

Declaration
From
+ (NSMappingModel *)mappingModelFromBundles:(NSArray *)bundles forSourceModel:(NSManagedObjectModel *)sourceModel destinationModel:(NSManagedObjectModel *)destinationModel
To
+ (NSMappingModel * _Nullable)mappingModelFromBundles:(NSArray<NSBundle *> * _Nullable)bundles forSourceModel:(NSManagedObjectModel * _Nullable)sourceModel destinationModel:(NSManagedObjectModel * _Nullable)destinationModel

NSMergePolicy.h

Declaration
From
@property(readonly, retain) NSDictionary *cachedSnapshot
To
@property(readonly, retain, nullable) NSDictionary<NSString *,id> *cachedSnapshot

Declaration
From
- (instancetype)initWithSource:(NSManagedObject *)srcObject newVersion:(NSUInteger)newvers oldVersion:(NSUInteger)oldvers cachedSnapshot:(NSDictionary *)cachesnap persistedSnapshot:(NSDictionary *)persnap
To
- (instancetype _Nonnull)initWithSource:(NSManagedObject * _Nonnull)srcObject newVersion:(NSUInteger)newvers oldVersion:(NSUInteger)oldvers cachedSnapshot:(NSDictionary<NSString *,id> * _Nullable)cachesnap persistedSnapshot:(NSDictionary<NSString *,id> * _Nullable)persnap

Declaration
From
@property(readonly, retain) NSDictionary *objectSnapshot
To
@property(readonly, retain, nullable) NSDictionary<NSString *,id> *objectSnapshot

Declaration
From
@property(readonly, retain) NSDictionary *persistedSnapshot
To
@property(readonly, retain, nullable) NSDictionary<NSString *,id> *persistedSnapshot

NSMigrationManager.h

Declaration
From
- (NSArray *)destinationInstancesForEntityMappingNamed:(NSString *)mappingName sourceInstances:(NSArray *)sourceInstances
To
- (NSArray<__kindof NSManagedObject *> * _Nonnull)destinationInstancesForEntityMappingNamed:(NSString * _Nonnull)mappingName sourceInstances:(NSArray<__kindof NSManagedObject *> * _Nullable)sourceInstances

Declaration
From
- (NSArray *)sourceInstancesForEntityMappingNamed:(NSString *)mappingName destinationInstances:(NSArray *)destinationInstances
To
- (NSArray<__kindof NSManagedObject *> * _Nonnull)sourceInstancesForEntityMappingNamed:(NSString * _Nonnull)mappingName destinationInstances:(NSArray<__kindof NSManagedObject *> * _Nullable)destinationInstances

NSPersistentStore.h

Declaration
From
@property(nonatomic, strong) NSDictionary *metadata
To
@property(nonatomic, strong) NSDictionary<NSString *,id> * _Null_unspecified metadata

Declaration
From
+ (NSDictionary *)metadataForPersistentStoreWithURL:(NSURL *)url error:(NSError **)error
To
+ (NSDictionary<NSString *,id> * _Nullable)metadataForPersistentStoreWithURL:(NSURL * _Nonnull)url error:(NSError * _Nullable * _Nullable)error

Declaration
From
+ (BOOL)setMetadata:(NSDictionary *)metadata forPersistentStoreWithURL:(NSURL *)url error:(NSError **)error
To
+ (BOOL)setMetadata:(NSDictionary<NSString *,id> * _Nullable)metadata forPersistentStoreWithURL:(NSURL * _Nonnull)url error:(NSError * _Nullable * _Nullable)error

NSPersistentStoreCoordinator.h

Declaration
From
- (NSPersistentStore *)addPersistentStoreWithType:(NSString *)storeType configuration:(NSString *)configuration URL:(NSURL *)storeURL options:(NSDictionary *)options error:(NSError **)error
To
- (__kindof NSPersistentStore * _Nullable)addPersistentStoreWithType:(NSString * _Nonnull)storeType configuration:(NSString * _Nullable)configuration URL:(NSURL * _Nullable)storeURL options:(NSDictionary * _Nullable)options error:(NSError * _Nullable * _Nullable)error

Declaration
From
- (NSDictionary *)metadataForPersistentStore:(NSPersistentStore *)store
To
- (NSDictionary<NSString *,id> * _Nonnull)metadataForPersistentStore:(NSPersistentStore * _Nonnull)store

DeclarationDeprecation
From
+ (NSDictionary *)metadataForPersistentStoreOfType:(NSString *)storeType URL:(NSURL *)url error:(NSError **)error
--
To
+ (NSDictionary<NSString *,id> * _Nullable)metadataForPersistentStoreOfType:(NSString * _Nullable)storeType URL:(NSURL * _Nonnull)url error:(NSError * _Nullable * _Nullable)error
iOS 9.0

Declaration
From
- (NSPersistentStore *)persistentStoreForURL:(NSURL *)URL
To
- (__kindof NSPersistentStore * _Nullable)persistentStoreForURL:(NSURL * _Nonnull)URL

Declaration
From
@property(readonly, strong) NSArray *persistentStores
To
@property(readonly, strong, nonnull) NSArray<__kindof NSPersistentStore *> *persistentStores

Declaration
From
+ (NSDictionary *)registeredStoreTypes
To
+ (NSDictionary<NSString *,NSValue *> * _Nonnull)registeredStoreTypes

Declaration
From
- (void)setMetadata:(NSDictionary *)metadata forPersistentStore:(NSPersistentStore *)store
To
- (void)setMetadata:(NSDictionary<NSString *,id> * _Nullable)metadata forPersistentStore:(NSPersistentStore * _Nonnull)store

DeclarationDeprecation
From
+ (BOOL)setMetadata:(NSDictionary *)metadata forPersistentStoreOfType:(NSString *)storeType URL:(NSURL *)url error:(NSError **)error
--
To
+ (BOOL)setMetadata:(NSDictionary<NSString *,id> * _Nullable)metadata forPersistentStoreOfType:(NSString * _Nullable)storeType URL:(NSURL * _Nonnull)url error:(NSError * _Nullable * _Nullable)error
iOS 9.0

NSPersistentStoreRequest.h

Declaration
From
@property(nonatomic, strong) NSArray *affectedStores
To
@property(nonatomic, strong, nullable) NSArray<NSPersistentStore *> *affectedStores

NSPersistentStoreResult.h

NSPropertyDescription.h

Declaration
From
- (void)setValidationPredicates:(NSArray *)validationPredicates withValidationWarnings:(NSArray *)validationWarnings
To
- (void)setValidationPredicates:(NSArray<NSPredicate *> * _Nullable)validationPredicates withValidationWarnings:(NSArray<NSString *> * _Nullable)validationWarnings

Declaration
From
@property(readonly, strong) NSArray *validationPredicates
To
@property(readonly, strong, nonnull) NSArray<NSPredicate *> *validationPredicates

NSSaveChangesRequest.h

Declaration
From
@property(readonly, strong) NSSet *deletedObjects
To
@property(readonly, strong, nullable) NSSet<__kindof NSManagedObject *> *deletedObjects

Declaration
From
- (instancetype)initWithInsertedObjects:(NSSet *)insertedObjects updatedObjects:(NSSet *)updatedObjects deletedObjects:(NSSet *)deletedObjects lockedObjects:(NSSet *)lockedObjects
To
- (instancetype _Nonnull)initWithInsertedObjects:(NSSet<NSManagedObject *> * _Nullable)insertedObjects updatedObjects:(NSSet<NSManagedObject *> * _Nullable)updatedObjects deletedObjects:(NSSet<NSManagedObject *> * _Nullable)deletedObjects lockedObjects:(NSSet<NSManagedObject *> * _Nullable)lockedObjects

Declaration
From
@property(readonly, strong) NSSet *insertedObjects
To
@property(readonly, strong, nullable) NSSet<__kindof NSManagedObject *> *insertedObjects

Declaration
From
@property(readonly, strong) NSSet *lockedObjects
To
@property(readonly, strong, nullable) NSSet<__kindof NSManagedObject *> *lockedObjects

Declaration
From
@property(readonly, strong) NSSet *updatedObjects
To
@property(readonly, strong, nullable) NSSet<__kindof NSManagedObject *> *updatedObjects