Type Method

metadataForPersistentStoreOfType:URL:error:

Returns a dictionary containing the metadata stored in the persistent store at a given URL.

Declaration

+ (NSDictionary<NSString *,id> *)metadataForPersistentStoreOfType:(NSString *)storeType URL:(NSURL *)url error:(NSError * _Nullable *)error;

Parameters

storeType

The type of the store at url. If this value is nil, Core Data determines which store class should be used to get or set the store file's metadata by inspecting the file contents.

url

The location of a persistent store.

error

If no store is found at url or if there is a problem accessing its contents, upon return contains an NSError object that describes the problem.

Return Value

A dictionary containing the metadata stored in the persistent store at url, or nil if the store cannot be opened or if there is a problem accessing its contents.

The keys guaranteed to be in this dictionary are NSStoreTypeKey and NSStoreUUIDKey.

Discussion

You can use this method to retrieve the metadata from a store without the overhead of creating a Core Data stack.

See Also

Deprecated

NSPersistentStoreDidImportUbiquitousContentChangesNotification

Posted after records are imported from the ubiquitous content store.

Deprecated
NSPersistentStoreUbiquitousTransitionType

These constants are used as the value corresponding to the NSPersistentStoreUbiquitousTransitionTypeKey in the user info dictionary of NSPersistentStoreCoordinatorStoresWillChangeNotification and NSPersistentStoreCoordinatorStoresDidChangeNotification notifications to identify the type of event leading to a change.

Deprecated
+ removeUbiquitousContentAndPersistentStoreAtURL:options:error:

Deletes all ubiquitous content for all peers for the persistent store at a given URL and also delete the local store file.

Deprecated
+ setMetadata:forPersistentStoreOfType:URL:error:

Sets the metadata for a given store.

Deprecated
- unlock

Relinquishes a previously acquired lock.

Deprecated
- lock

Attempts to acquire a lock.

Deprecated
- tryLock

Attempts to acquire a lock.

Deprecated

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software