Skip to content

Instantly share code, notes, and snippets.

@Rich86man
Created September 20, 2012 17:11
Show Gist options
  • Save Rich86man/3757118 to your computer and use it in GitHub Desktop.
Save Rich86man/3757118 to your computer and use it in GitHub Desktop.
- (void) invalidateInContext:(NSManagedObjectContext *)context
{
NSFetchRequest* request = [[NSFetchRequest alloc]initWithEntityName:kZODownloadName];
NSPredicate* predicate = [NSPredicate predicateWithFormat:@"targetEntity == %@", self.modelClassString];
request.predicate = predicate;
NSArray* downloads = [context executeFetchRequest:request error:nil];
for (ZODownload* download in downloads) {
[context deleteObject:download];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment