How to delete all data in CoreData?
Is there a quick way to clear all data of my CoreData without calling deleteObject f开发者_开发技巧or each entity in the model?
Delete the persistent store on disk (after calling -[NSPersistentStoreCoordinator removePersistentStore:error:]
for any persistent store coordinator that refers to the store). You probably also want to reset any NSManagedObjectContext
instances that may have managed object instances from that store before removing and deleting the store on disk.
You can release all your NSPersistentStoreCoordinator
and all you NSManagedObjectContest
's then delete the file in the FS and recreate it.
精彩评论