nsbatchdeleterequest

Why entries are not deleted until app is restarted or I execute my NSBatchDeleteRequest twice?

风流意气都作罢 提交于 2020-01-03 02:19:36
问题 I'm reading Delete/Reset all entries in Core Data?. If I follow the steps below, I get an unexpected result: Call the code below Then query an entity in the simulator, I will get an entity back!!! If I call clearCoreDataStore again (or do a restart), only then the value won't be retrieved from core-data What am I missing? func clearCoreDataStore() { let entities = dataManager.persistentContainer.managedObjectModel.entities for entity in entities { let fetchRequest = NSFetchRequest

Is NSInMemoryStoreType Incompatible with NSBatchDeleteRequest?

只谈情不闲聊 提交于 2019-12-08 05:00:43
问题 I am currently unit testing a layer that interacts with Core Data. It saves, deletes, and updates an Item object. However, my test that attempts to save a couple of Item s and then perform a batch deletion keeps failing. This is Item : extension Item { // MARK: - Properties @NSManaged public var date: NSDate @NSManaged public var isTaxable: Bool @NSManaged public var name: String @NSManaged public var price: NSDecimalNumber @NSManaged public var quantity: Double // MARK: - Fetch Requests