How Realm Object Can Be Invalid Without Deletion

I am using RealmSwift in a project and from time to time I get

Terminating app due to uncaught exception 'RLMException', reason: 'Object has been deleted or invalidated.'

      

I am not deleting any objects from my realm database, so the problem is not that the object was deleted elsewhere.

What are the other options?

+3


source to share


1 answer


An old thread that I know, but I just stumbled upon this issue. You will also see this error when the object is on the wrong stream:



// throw an exception if the object is invalidated or on the wrong thread
static inline void RLMVerifyAttached(__unsafe_unretained RLMObjectBase *const obj) 
{        
    if (!obj->_row.is_attached()) {
        @throw RLMException(@"Object has been deleted or invalidated.");
    }
    [obj->_realm verifyThread];
}

      

+1


source







All Articles