NSManagedObjectContext
Undocumented
-
Mechanica
Caches an
object
for akey
in this context.Declaration
Swift
public final func setCachedObject(_ object: NSManagedObject?, forKey key: String)
-
Mechanica
Returns a cached object in this context for a given
key
.Declaration
Swift
public final func cachedObject(forKey key: String) -> NSManagedObject?
-
Mechanica
Clears all cached object in this context.
Declaration
Swift
public final func clearCachedObjects()
-
Mechanica
Returns a dictionary that contains the metadata currently stored or to-be-stored in a given persistent store.
Declaration
Swift
public final func metaData(for store: NSPersistentStore) -> [String: Any]
-
Mechanica
Adds an
object
to the store’s metadata and saves it asynchronously.Declaration
Swift
public final func setMetaDataObject(_ object: AnyObject?, with key: String, for store: NSPersistentStore)
Parameters
object
Object to be added to the medata dictionary.
key
Object key
store
NSPersistentStore where is stored the metadata.
-
Mechanica
Returns the entity with the specified name from the managed object model associated with the specified managed object context’s persistent store coordinator.
Declaration
Swift
public final func entity(forEntityName name: String) -> NSEntityDescription
-
Mechanica
Declaration
Swift
public final func newBackgroundContext(asChildContext isChildContext: Bool = false) -> NSManagedObjectContext
Parameters
asChildContext
Specifies if this new context is a child context of the current context (default ).
Return Value
a
new
backgroundNSManagedObjectContext
.
-
Mechanica
Asynchronously performs changes and then saves them or rollbacks if any error occurs. - Parameters: - changes: Changes to be applied in the current context before the saving operation.
Declaration
Swift
public final func performSave(after changes: @escaping () -> Void)
Parameters
changes
Changes to be applied in the current context before the saving operation.
-
Mechanica
Synchronously performs changes and then saves them or rollbacks if any error occurs. - Throws: throws an error in cases of a saving operation failure.
Declaration
Swift
public final func performSaveAndWait(after changes: @escaping () -> Void) throws