mirror of
https://github.com/zhigang1992/MagicalRecord.git
synced 2026-05-22 07:41:46 +08:00
34 lines
1.2 KiB
Objective-C
34 lines
1.2 KiB
Objective-C
//
|
|
// NSManagedObjectContext+ActiveRecord.h
|
|
//
|
|
// Created by Saul Mora on 11/23/09.
|
|
// Copyright 2010 Magical Panda Software, LLC All rights reserved.
|
|
//
|
|
|
|
#import "ActiveRecordHelpers.h"
|
|
|
|
@interface NSManagedObjectContext (ActiveRecord)
|
|
|
|
- (void) observeContext:(NSManagedObjectContext *)otherContext;
|
|
- (void) stopObservingContext:(NSManagedObjectContext *)otherContext;
|
|
- (void) observeContextOnMainThread:(NSManagedObjectContext *)otherContext;
|
|
|
|
- (BOOL) save;
|
|
- (BOOL) saveOnMainThread;
|
|
- (BOOL) saveOnBackgroundThread;
|
|
- (void) setNotifiesMainContextOnSave:(BOOL)enabled;
|
|
|
|
+ (void) resetDefaultContext;
|
|
+ (NSManagedObjectContext *) defaultContext;
|
|
+ (void) setDefaultContext:(NSManagedObjectContext *)moc;
|
|
+ (NSManagedObjectContext *) contextForCurrentThread;
|
|
|
|
+ (NSManagedObjectContext *) context;
|
|
+ (NSManagedObjectContext *) contextThatNotifiesDefaultContextOnMainThread;
|
|
+ (NSManagedObjectContext *) contextThatNotifiesDefaultContextOnMainThreadWithCoordinator:(NSPersistentStoreCoordinator *)coordinator;
|
|
+ (NSManagedObjectContext *) contextWithStoreCoordinator:(NSPersistentStoreCoordinator *)coordinator;
|
|
|
|
@property (nonatomic, assign) BOOL notifiesMainContextOnSave;
|
|
|
|
@end
|