Realm object deleted or invalidated without any deletions occurring for these objects


Hi All,

We’re using realm heavily in a pretty big app, we use it mainly for cache purposes (save from server to realm, read from realm). Our biggest crash right now is the “deleted or invalidated error”.

Now, I’ve done a lot of reading and I understand why this happens and it makes sense but the issue here is we’re not really deleting these objects, so I’m trying to understand what other cases besides a delete or a call invalidate makes this happen.

I can’t share a ton of code since it’s really just everywhere but usually it’s a reference to a realm object in some view controller that causes this error when accessed. I’ve fixed some cases by accessing realm whenever needed instead of keeping a reference but I don’t think this is a good solution for the entire app.