I'm trying to use an NSFetchedResultsController(FRC) for my UITableViewController because I like the functionality that comes with a FRC as opposed to trying to manually manage my UITableView
My problem is that I need to have a filter on my table view, and my filter cannot easily be accomplished without using 'predicateWithBlock' which doesn't work with my FRC See Related Post
So what I want to do at this point is to create a context specifically for my FRC, then only add the objects I want to display in my FRC to this separate context. This way my FRC doesn't need to filter anything, it only needs to pull objects directly out of this temporary context.
So my question is how can I create this 'child' context? Is this even a good idea?
I've tried to create an empty context then insert objects from the main context, but it did not look trivial trying to manually copy NSManagedObjects from one context to another. I'm wondering if there's a better way to create a subset that I'm missing?
NSMangedObjectContext * myFRCContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
NSArray * managedFoobarObjectsToInsert = [myRealContext getFoobarObjects];
for(id managedObject in managedObjectsToInsert) {
if([managedObject passesFilterConditions])
//...now what?
}