I’m writing an iOS app which utilizes Core Data (NSManagedObject, NSManagedObjectContext..etc) and I was wondering if there is a way to delete an object from the database that meets specific criteria. For example, suppose I have a database of “Form” entities. Is there a fast way to delete the form whose attribute name is equal to, say, the word @”Untitled”. I know that I could fetch the object and then use - (void)deleteObject:(NSManagedObject *)object method of NSManagedObjectContext but this seems like it would be extremely slow to fetch an entire entity into memory just so that we can turn around and delete it.
I’m writing an iOS app which utilizes Core Data (NSManagedObject, NSManagedObjectContext..etc) and I was
Share
Unfortunately, you actually do have to fetch objects that you want to delete.