Added convenience function for getting a fetch request from an array of fetch request blocks

This commit is contained in:
Blake Watters
2012-10-17 22:34:09 -04:00
parent feb998ea84
commit 68cebc96af
2 changed files with 19 additions and 0 deletions

View File

@@ -29,6 +29,16 @@
#undef RKLogComponent
#define RKLogComponent RKlcl_cRestKitCoreData
NSFetchRequest *RKFetchRequestFromBlocksWithURL(NSArray *fetchRequestBlocks, NSURL *URL)
{
NSFetchRequest *fetchRequest = nil;
for (RKFetchRequestBlock block in [fetchRequestBlocks reverseObjectEnumerator]) {
fetchRequest = block(URL);
if (fetchRequest) break;
}
return fetchRequest;
}
@interface RKManagedObjectRequestOperation () <RKMapperOperationDelegate>
// Core Data specific
@property (readwrite, nonatomic, strong) NSManagedObjectContext *privateContext;