Permalink
Browse files

Ignore changes from other main contexts in mapping coordinator

  • Loading branch information...
1 parent 2beaea8 commit 3cad36db4b87ac680faa6af6492cc74fffa91c84 @sebreh sebreh committed Feb 20, 2014
Showing with 3 additions and 1 deletion.
  1. +3 −1 PodioKit/Core/PKCoreDataMappingCoordinator.m
View
4 PodioKit/Core/PKCoreDataMappingCoordinator.m
@@ -48,7 +48,9 @@ - (PKObjectMapper *)objectMapper {
- (void)mappingContextDidSave:(NSNotification *)notification {
// Ignore save notifications from main context
- if (notification.object == self.managedObjectContext) return;
+ NSManagedObjectContext *savedContext = notification.object;
+ if (savedContext == self.managedObjectContext ||
+ savedContext.concurrencyType != NSPrivateQueueConcurrencyType) return;
// Merge changes from background context to main context
NSManagedObjectContext *context = self.managedObjectContext;

0 comments on commit 3cad36d

Please sign in to comment.