Move main thread assert to the right spot.
This commit is contained in:
parent
4f0065fba8
commit
a1264e0f91
@ -51,6 +51,8 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted );
|
||||
|
||||
+ (NSManagedObjectContext *)managedObjectContextForMainThreadIfReady {
|
||||
|
||||
NSAssert( [[NSThread currentThread] isMainThread], @"Direct access to main MOC only allowed from the main thread." );
|
||||
|
||||
NSManagedObjectContext *mainManagedObjectContext = [[self get] mainManagedObjectContextIfReady];
|
||||
if (!mainManagedObjectContext || ![[NSThread currentThread] isMainThread])
|
||||
return nil;
|
||||
@ -154,8 +156,6 @@ PearlAssociatedObjectProperty( NSNumber*, StoreCorrupted, storeCorrupted );
|
||||
|
||||
- (NSManagedObjectContext *)mainManagedObjectContextIfReady {
|
||||
|
||||
NSAssert( [[NSThread currentThread] isMainThread], @"Can only access main MOC from the main thread." );
|
||||
|
||||
[self loadStore];
|
||||
|
||||
if (!self.mainManagedObjectContext && self.privateManagedObjectContext.persistentStoreCoordinator) {
|
||||
|
Loading…
Reference in New Issue
Block a user