I\'m trying to delete all the objects, but I can\'t seem to make it work. I know there is other questions for this kind of question, but they are not helpful. What I want is to
So, what have you tried so far?
As per the documentation.
Deleting a managed object is straightforward. You simply send its managed object context a
deleteObject:
message, passing the object you want to delete as the argument.
In other words, using a valid context you shoul say
[aValidContext deleteObject:managedObjectYouWantToDelete];
About your question, you need to
Fixture
itemsNSArray
) and perform the deletionFor example
NSFetchRequest* request = // create the request here...
NSError *error;
NSArray *array = [aValidContext executeFetchRequest:request error:&error];
if (array == nil) {
// Deal with error...
} else {
// loop the array performing deleteObject
}
// save to persistent store
Remaining code is left for exercise ;)
Edit 1
Reading again your question, what is the relationship between Section
and Fixture
? If they are separated entities, you should perform previous steps also for Section
s.