Declared in NSManagedObjectContext+MagicalSaves.h

Tasks

  • – MR_saveOnlySelfWithCompletion:

    Asynchronously save changes in the current context and it’s parent. Executes a save on the current context’s dispatch queue asynchronously. This method only saves the current context, and the parent of the current context if one is set. The completion block will always be called on the main queue.

  • – MR_saveToPersistentStoreWithCompletion:

    Asynchronously save changes in the current context all the way back to the persistent store. Executes asynchronous saves on the current context, and any ancestors, until the changes have been persisted to the assigned persistent store. The completion block will always be called on the main queue.

  • – MR_saveOnlySelfAndWait

    Synchronously save changes in the current context and it’s parent. Executes a save on the current context’s dispatch queue. This method only saves the current context, and the parent of the current context if one is set. The method will not return until the save is complete.

  • – MR_saveToPersistentStoreAndWait

    Synchronously save changes in the current context all the way back to the persistent store. Executes saves on the current context, and any ancestors, until the changes have been persisted to the assigned persistent store. The method will not return until the save is complete.

  • – MR_saveWithOptions:completion:

    Save the current context with options. All other save methods are conveniences to this method.

Instance Methods

MR_saveOnlySelfAndWait

- (void)MR_saveOnlySelfAndWait
Discussion

Synchronously save changes in the current context and it’s parent. Executes a save on the current context’s dispatch queue. This method only saves the current context, and the parent of the current context if one is set. The method will not return until the save is complete.

Availability

Available in v2.1.0 and later.

Declared In

NSManagedObjectContext+MagicalSaves.h

MR_saveOnlySelfWithCompletion:

- (void)MR_saveOnlySelfWithCompletion:(MRSaveCompletionHandler)completion
Discussion

Asynchronously save changes in the current context and it’s parent. Executes a save on the current context’s dispatch queue asynchronously. This method only saves the current context, and the parent of the current context if one is set. The completion block will always be called on the main queue.

Parameters

completion

Completion block that is called after the save has completed. The block is passed a success state as a BOOL and an NSError instance if an error occurs. Always called on the main queue.

Availability

Available in v2.1.0 and later.

Declared In

NSManagedObjectContext+MagicalSaves.h

MR_saveToPersistentStoreAndWait

- (void)MR_saveToPersistentStoreAndWait
Discussion

Synchronously save changes in the current context all the way back to the persistent store. Executes saves on the current context, and any ancestors, until the changes have been persisted to the assigned persistent store. The method will not return until the save is complete.

Availability

Available in v2.1.0 and later.

Declared In

NSManagedObjectContext+MagicalSaves.h

MR_saveToPersistentStoreWithCompletion:

- (void)MR_saveToPersistentStoreWithCompletion:(MRSaveCompletionHandler)completion
Discussion

Asynchronously save changes in the current context all the way back to the persistent store. Executes asynchronous saves on the current context, and any ancestors, until the changes have been persisted to the assigned persistent store. The completion block will always be called on the main queue.

Parameters

completion

Completion block that is called after the save has completed. The block is passed a success state as a BOOL and an NSError instance if an error occurs. Always called on the main queue.

Availability

Available in v2.1.0 and later.

Declared In

NSManagedObjectContext+MagicalSaves.h

MR_saveWithOptions:completion:

- (void)MR_saveWithOptions:(MRSaveOptions)saveOptions completion:(MRSaveCompletionHandler)completion
Discussion

Save the current context with options. All other save methods are conveniences to this method.

Parameters

saveOptions

Bitmasked options for the save process.

completion

Completion block that is called after the save has completed. The block is passed a success state as a BOOL and an NSError instance if an error occurs. Always called on the main queue.

Availability

Available in v2.1.0 and later.

Declared In

NSManagedObjectContext+MagicalSaves.h