Type Method

setMetadata(_:forPersistentStoreOfType:at:)

Sets the metadata for a given store.

Declaration

class func setMetadata(_ metadata: [String : Any]?, forPersistentStoreOfType storeType: String?, at url: URL) throws

Parameters

metadata

A dictionary containing metadata for the store.

storeType

The type of the store at url. If this value is nil, Core Data will determine 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 setting its metadata, upon return contains an NSError object that describes the problem.

Return Value

true if the metadata was set correctly, otherwise false.

Discussion

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

See Also

Deprecated

static let NSPersistentStoreDidImportUbiquitousContentChanges: NSNotification.Name

Posted after records are imported from the ubiquitous content store.

Deprecated
enum NSPersistentStoreUbiquitousTransitionType

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

Deprecated
class func removeUbiquitousContentAndPersistentStore(at: URL, options: [AnyHashable : Any]?)

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

Deprecated
class func metadataForPersistentStore(ofType: String?, at: URL) -> [String : Any]

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

Deprecated
func unlock()

Relinquishes a previously acquired lock.

Deprecated
func lock()

Attempts to acquire a lock.

Deprecated
func tryLock() -> Bool

Attempts to acquire a lock.

Deprecated