I have the following structure
Persistent Store <-> Parent Context <-> MOC (on Main Thread) <-> background thread MOC (MOC = Managed Object Context)
So im doing some work on a background context
// Create a background context.
NSManagedObjectContext* context = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
context.parentContext = self.document.managedObjectContext;
// Start using it, but in its own thread!
[context performBlock:^
{...
I fetch some objects from a table and delete some of them on the context.
NSFetchRequest* request = [NSFetchRequest fetchRequestWithEntityName:@"User"];
NSArray* userQueryResults = [context executeFetchRequest:request error:&error];
for (int i = 0; i < userQueryResults.count; i++)
{
if(someCondition)
[context deleteObject:[userQueryResults objectAtIndex:bla];
}
Now, say i want to refetch just the remaining users into an array...
Will it refetch all the users that were originally there or only refetch the ones that weren't deleted?
If I was to save my 'context' would it make any difference?
Basically I'm trying to understand the difference between fetches and saves with nested contexts...
Thanks