What is the most efficient way to delete a large number (10.000+) objects in Core Data?

后端 未结 6 1349
青春惊慌失措
青春惊慌失措 2020-12-17 01:07

The way I\'m trying to delete multiple sets of 10.000+ NSManagedObjects is just too memory intensive (around 20MB live bytes), and my app is being jettisoned. Here is the im

6条回答
  •  醉酒成梦
    2020-12-17 01:53

    NSBatchDeleteRequest Worked for me; reduced the time for deletion of managed objects by a factor of 5, with no memory spike.

提交回复
热议问题