I am using DBAccess
framework and would like to delete a record based on a condition however there is no example provided on Sample and Documentation. I see only one method removeObjectWithIdentifier
in DBFuzzystore
class but I am not using this class anywhere in my project. Is there a simple example where I would like to delete a record on a given condition. E.g. I would like to delete a record if record was created between a given date.
Yeah, removals are made on result sets or individual objects. For example.
[[[[MenuItem query] where:@"MenuTitle = 'Sample'"] fetch] removeAll];
or call remove on any single DBObject derived class.
for (MenuItem* item in [[[MenuItem query] where:@"MenuTitle = 'Sample'"] fetch]) {
[item remove];
}
Hope this makes sense.