Reputation: 468
How can i delete all objects in Realm at run time ?
I've already seen this question but the answer can only be used at the launch of the app. But I want to delete everything at launch time. How can i do this ?
Upvotes: 0
Views: 1544
Reputation: 14086
For now you will need to do this for each object type:
RLMResults *arrayOfObjects = [Person allObjects]; [realm deleteObjects:arrayOfObjects];
We're working on a way to make this easier
[realm beginWriteTransaction];
[realm deleteAllObjects];
[realm commitWriteTransaction];
Upvotes: 3