diff --git a/Code/CoreData/RKManagedObjectLoader.m b/Code/CoreData/RKManagedObjectLoader.m index f16f46284c..e07384c359 100644 --- a/Code/CoreData/RKManagedObjectLoader.m +++ b/Code/CoreData/RKManagedObjectLoader.m @@ -136,7 +136,7 @@ - (void)deleteCachedObjectsMissingFromResult:(RKObjectMappingResult*)result { // NOTE: We are on the background thread here, be mindful of Core Data's threading needs - (void)processMappingResult:(RKObjectMappingResult*)result { - NSAssert(![NSThread isMainThread], @"Mapping result processing should occur on a background thread"); + NSAssert(_sentSynchronously || ![NSThread isMainThread], @"Mapping result processing should occur on a background thread"); if (_targetObjectID && self.targetObject && self.method == RKRequestMethodDELETE) { NSManagedObject* backgroundThreadObject = [self.objectStore objectWithID:_targetObjectID]; RKLogInfo(@"Deleting local object %@ due to DELETE request", backgroundThreadObject); diff --git a/Code/ObjectMapping/RKObjectLoader.m b/Code/ObjectMapping/RKObjectLoader.m index 5a401d66fc..348e8692a6 100644 --- a/Code/ObjectMapping/RKObjectLoader.m +++ b/Code/ObjectMapping/RKObjectLoader.m @@ -146,7 +146,7 @@ - (void)informDelegateOfObjectLoadWithResultDictionary:(NSDictionary*)resultDict @protected */ - (void)processMappingResult:(RKObjectMappingResult*)result { - NSAssert(![NSThread isMainThread], @"Mapping result processing should occur on a background thread"); + NSAssert(_sentSynchronously || ![NSThread isMainThread], @"Mapping result processing should occur on a background thread"); [self performSelectorOnMainThread:@selector(informDelegateOfObjectLoadWithResultDictionary:) withObject:[result asDictionary] waitUntilDone:YES]; }