Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (21 sloc) 1.104 kB
//
// MagicalRecord+Actions.h
//
// Created by Saul Mora on 2/24/11.
// Copyright 2011 Magical Panda Software. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "NSManagedObjectContext+MagicalRecord.h"
@interface MagicalRecord (Actions)
/* For saving on the current thread as the caller, only with a seperate context. Useful when you're managing your own threads/queues and need a serial call to create or change data
*/
+ (void) saveWithBlock:(void(^)(NSManagedObjectContext *localContext))block;
/* For all background saving operations. These calls will be sent to a different thread/queue.
*/
+ (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block;
+ (void) saveInBackgroundWithBlock:(void(^)(NSManagedObjectContext *localContext))block completion:(void(^)(void))callback;
/*
If you want to reuse the context on the current thread, use this method.
*/
+ (void) saveInBackgroundUsingCurrentContextWithBlock:(void (^)(NSManagedObjectContext *))block completion:(void (^)(void))completion errorHandler:(void (^)(NSError *))errorHandler;
@end
Jump to Line
Something went wrong with that request. Please try again.