mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-01-12 22:51:50 +08:00
Add performBlockAndWait: invocation to RKFetchRequestManagedObjectCache
This commit is contained in:
@@ -80,8 +80,11 @@ static NSPredicate *RKPredicateWithSubsitutionVariablesForAttributeValues(NSDict
|
||||
|
||||
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:[entity name]];
|
||||
fetchRequest.predicate = [substitutionPredicate predicateWithSubstitutionVariables:attributeValues];
|
||||
NSError *error = nil;
|
||||
NSArray *objects = [managedObjectContext executeFetchRequest:fetchRequest error:&error];
|
||||
__block NSError *error = nil;
|
||||
__block NSArray *objects = nil;
|
||||
[managedObjectContext performBlockAndWait:^{
|
||||
objects = [managedObjectContext executeFetchRequest:fetchRequest error:&error];
|
||||
}];
|
||||
if (! objects) {
|
||||
RKLogError(@"Failed to execute fetch request due to error: %@", error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user