NSManagedObjectContext
Undocumented
-
Convenience method to synchronously save the
NSManagedObjectContext
if changes are present. Method also ensures that the save is executed on the correct queue when using Main/Private queue concurrency types.Throws
Errors produced by thesave()
function on theNSManagedObjectContext
Declaration
Swift
public func saveContextAndWait() throws
-
Convenience method to asynchronously save the
NSManagedObjectContext
if changes are present. Method also ensures that the save is executed on the correct queue when using Main/Private queue concurrency types.Declaration
Swift
public func saveContext(_ completion: CoreDataStackSaveCompletion? = nil)
-
Convenience method to synchronously save the
NSManagedObjectContext
if changes are present. If any parent contexts are found, they too will be saved synchronously. Method also ensures that the save is executed on the correct queue when using Main/Private queue concurrency types.Throws
Errors produced by thesave()
function on theNSManagedObjectContext
Declaration
Swift
public func saveContextToStoreAndWait() throws
-
Convenience method to asynchronously save the
NSManagedObjectContext
if changes are present. If any parent contexts are found, they too will be saved asynchronously. Method also ensures that the save is executed on the correct queue when using Main/Private queue concurrency types.Declaration
Swift
public func saveContextToStore(_ completion: CoreDataStackSaveCompletion? = nil)
-
Synchronously executes a given function on the receiver’s queue.
You use this method to safely address managed objects on a concurrent queue.
Attention
This method may safely be called reentrantly.Throws
Any error thrown by the inner function. This method should be technicallyrethrows
, but cannot be due to Swift limitations.Declaration
Swift
public func performAndWaitOrThrow<Return>(_ body: () throws -> Return) rethrows -> Return