Permalink
Browse files

Tweak to context watcher delegate notifications

  • Loading branch information...
1 parent 572b86a commit a867e42930b8d0adfe57927adffb5ba4ce29fe44 Marcus S. Zarra committed Sep 28, 2010
Showing with 5 additions and 2 deletions.
  1. +5 −2 ZSContextWatcher.m
View
@@ -67,7 +67,10 @@ - (void)addEntityToWatch:(NSEntityDescription*)description withPredicate:(NSPred
- (void)contextUpdated:(NSNotification*)notification
{
NSManagedObjectContext *incomingContext = [notification object];
- if ([incomingContext persistentStoreCoordinator] != [self persistentStoreCoordinator]) return;
+ NSPersistentStoreCoordinator *incomingCoordinator = [incomingContext persistentStoreCoordinator];
+ if (incomingCoordinator != [self persistentStoreCoordinator]) {
+ return;
+ }
if ([self reference]) {
DLog(@"%@ entered", [self reference]);
}
@@ -98,7 +101,7 @@ - (void)contextUpdated:(NSNotification*)notification
if ([self reference]) {
DLog(@"%@++++++++++firing action", [self reference]);
}
- [[self delegate] performSelector:[self action] withObject:self withObject:results];
+ [[self delegate] performSelectorOnMainThread:[self action] withObject:self waitUntilDone:YES];
} else {
if ([self reference]) {
DLog(@"%@----------delegate doesn't respond", [self reference]);

0 comments on commit a867e42

Please sign in to comment.