2
0

Avoid using object.managedObjectContext - when no strong reference exists to the MOC, it may yield nil.

[FIXED]     Unexpected nil MOCs.
This commit is contained in:
Maarten Billemont
2013-04-30 01:49:53 -04:00
parent 0ee1e176ed
commit 40f34f3d77
15 changed files with 329 additions and 92 deletions

View File

@@ -77,7 +77,7 @@ static NSDictionary *keyQuery(MPUserEntity *user) {
[[NSNotificationCenter defaultCenter] postNotificationName:MPSignedOutNotification object:self userInfo:@{ @"animated" : @(animated) }];
}
- (BOOL)signInAsUser:(MPUserEntity *)user inContext:(NSManagedObjectContext *)moc usingMasterPassword:(NSString *)password {
- (BOOL)signInAsUser:(MPUserEntity *)user saveInContext:(NSManagedObjectContext *)moc usingMasterPassword:(NSString *)password {
if (password)
NSAssert(![NSThread isMainThread], @"Computing key may not happen from the main thread.");