Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "SMDocument.h"
- @implementation SMDocument
- - (id)init {
- self = [super init];
- if (self) {
- NSManagedObjectContext *context = self.managedObjectContext;
- if (context.concurrencyType != NSMainQueueConcurrencyType) {
- NSUndoManager *undoManager = context.undoManager;
- NSPersistentStoreCoordinator *coordinator = context.persistentStoreCoordinator;
- context = [NSManagedObjectContext newMainQueueContext];
- context.persistentStoreCoordinator = coordinator;
- context.undoManager = undoManager;
- self.managedObjectContext = context;
- }
- NSAssert1(self.managedObjectContext.concurrencyType == NSMainQueueConcurrencyType, @"Wrong concurrency type: %li", self.managedObjectContext.concurrencyType);
- }
- return self;
- }
- @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement