Pergunta

I am using Core Data in my app,

and maybe my users wants to delete all the NSManagedObjects that they once saved,

So is there a quick method of NSManagedObjectContext that can do this, I mean, clear the whole persistent store, or in another word,delete all objects of every entity, so there's no actual objects (except entities) in core data?

Thanks a lot!

Foi útil?

Solução

You can either delete everything entity-by-entity or clear the store file itself.

See this solution: Delete/Reset all entries in Core Data?

Outras dicas

Just delete the file and recreate your persistent store, then everything is nice and empty.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top