Checking for duplicates when importing to CoreData

前端 未结 1 1255
礼貌的吻别
礼貌的吻别 2021-01-28 02:54

I\'m importing data into a Core Data store using RestKit and need to check for duplicates. If the item is already in the store, I\'d like to update it with the latest attribute

相关标签:
1条回答
  • 2021-01-28 03:36

    As far I know, the best way to find and/or import objects within Core Data is described in Implementing Find-or-Create Efficiently.

    The documentation describes a find or create pattern that it's based on sorting data: the data you download from the service and the data you grab form the store.

    I really suggest you to read the link I provided. You will see a speed up on your performances.

    Obviously you should do the work in background, preventing the main thread to freeze, using thread confinement or new iOS Core Data queue API.

    Hope that helps.

    0 讨论(0)
提交回复
热议问题