Check if the realm object is deleted

Realm java has an isValid () function to check if a realm / object has been deleted is invalid.

Is there a similar function to find it in the swift area?

I get a “Realm object was deleted or invalid” crash quite often when updating these objects.

+4
source share
1 answer

An object can no longer be accessed if the object was deleted from the containing realmor if isInvalidatedcalled in the containing realm.

This is the documentation Object.isInvalidated .

add override var isInvalidated: Bool { return super.isInvalidated }onObject

+6
source

Source: https://habr.com/ru/post/1649267/


All Articles