How can I do safe delete using Realm

孤者浪人 提交于 2019-12-13 09:51:46

问题


Some times app crashes saying object has been deleted.

Please let me know how can I delete with catch exception.


回答1:


you have to check for the object if it is invalidated or not

if !myObject.isInvalidated {
    //the object exists and it is safe to handle it
}


来源:https://stackoverflow.com/questions/46291463/how-can-i-do-safe-delete-using-realm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!