Swift Remove Object from Realm

后端 未结 6 1094
庸人自扰
庸人自扰 2021-02-04 04:06

I have Realm Object that save list from the JSON Response. But now i need to remove the object if the object is not on the list again from JSON. How i do that? This is my init f

6条回答
  •  有刺的猬
    2021-02-04 05:02

    The first suggestion that comes to mind is to delete all objects before inserting new objects from JSON.

    Lear more about deleting objects in Realm at https://realm.io/docs/swift/latest/#deleting-objects

提交回复
热议问题