Skip to content
Snippets Groups Projects
Commit ed800460 authored by cramakri's avatar cramakri
Browse files

Made the cache sync actually run in a secondary thread.

SVN: 27450
parent e49acba0
No related branches found
No related tags found
No related merge requests found
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
@property (readonly, strong) NSManagedObjectModel *managedObjectModel; @property (readonly, strong) NSManagedObjectModel *managedObjectModel;
@property (readonly, strong) NSPersistentStoreCoordinator *persistentStoreCoordinator; @property (readonly, strong) NSPersistentStoreCoordinator *persistentStoreCoordinator;
@property (readonly, strong) NSEntityDescription *ipadEntityDescription; @property (readonly, strong) NSEntityDescription *ipadEntityDescription;
@property (readonly, strong) NSOperationQueue *queue;
// Initialization // Initialization
......
...@@ -99,6 +99,8 @@ static NSManagedObjectContext* GetMainThreadManagedObjectContext(NSURL* storeUrl ...@@ -99,6 +99,8 @@ static NSManagedObjectContext* GetMainThreadManagedObjectContext(NSURL* storeUrl
_ipadEntityDescription = [NSEntityDescription entityForName: @"CISDOBIpadEntity" inManagedObjectContext: _managedObjectContext]; _ipadEntityDescription = [NSEntityDescription entityForName: @"CISDOBIpadEntity" inManagedObjectContext: _managedObjectContext];
_managedObjectModel = [_ipadEntityDescription managedObjectModel]; _managedObjectModel = [_ipadEntityDescription managedObjectModel];
_queue = [[NSOperationQueue alloc] init];
return self; return self;
} }
...@@ -110,8 +112,7 @@ static NSManagedObjectContext* GetMainThreadManagedObjectContext(NSURL* storeUrl ...@@ -110,8 +112,7 @@ static NSManagedObjectContext* GetMainThreadManagedObjectContext(NSURL* storeUrl
[synchronizer run]; [synchronizer run];
[synchronizer performSelectorOnMainThread: @selector(notifyCallOfResult:) withObject: nil waitUntilDone: NO]; [synchronizer performSelectorOnMainThread: @selector(notifyCallOfResult:) withObject: nil waitUntilDone: NO];
}; };
NSBlockOperation *blockOp = [NSBlockOperation blockOperationWithBlock: syncBlock]; [_queue addOperationWithBlock: syncBlock];
[blockOp start];
} }
- (CISDOBIpadServiceManagerCall *)managerCallWrappingServiceCall:(CISDOBAsyncCall *)serviceCall pruning:(BOOL)prune - (CISDOBIpadServiceManagerCall *)managerCallWrappingServiceCall:(CISDOBAsyncCall *)serviceCall pruning:(BOOL)prune
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment