RLMException: Object has been deleted or invalidated


#1

Hi. Randomly I’m getting the exception while the object is accessed in various places. Crashes are usually in the “makeBoxedGetter” when I’m accessing the object’s properties or in the [RLMResults indexOfObject:] when I’m accessing modified objects in the notification’s block.

What can I fo to improve the stability in these cases?


#2

The first question is; are you trying to access an object that’s been deleted? If so, how and why is that happening? Do you have a short code example so we can see what makeBoxedGetter is doing?


#3

I don’t know if it’s deleted or just modified (it might be both), the exception happens on prod in less than 1% sessions. “makeBoxedGetter” - is the RLM getter in the RLMObject_Private.hpp, so basically it happens on [Object getProperty].

Objects are updated in background, so it might be deleted.