How do I create many temporary objects and then save only one using Core Data?

后端 未结 3 1330
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-14 02:20

I am working on an application that will perform a search against an online service and generate many Result objects. A Result object is an NSManagedObject, initialized as requi

3条回答
  •  误落风尘
    2021-02-14 02:58

    I prefer to use a NIL context and have a base domain model class to handle recursively adding objects to a valid context when I want to persist them. It works really nicely (and cleanly!)... code available here... Temporary Core Data

提交回复
热议问题