Reputation: 2252
In my project I am using MagicalRecord
framework (implementation of active record pattern for Core Data
on iOS). How can I retrieve all existing ENTITIES from my .xcdatamodeld
file? I have to iterate though all entities (classes that inherit from managed object in my project) to truncate stored data.
I have only default configuration set in my model file. So for the following data model:
My code that show how it should look like:
NSArray *myEntities = // Retrive my entities.
foreach (Class *c in myEntities) {
[c MR_truncateAll];
}
Upvotes: 1
Views: 1022