Accessed from incorrect thread.... unmanaged objects


(Jose Solorzano) #1

I’m trying to persist to Realm using supposedly unmanaged copies of my objects:

let unamanged = MyModel(value : instance)

I only do this once, a background thread, and write it to Realm.

However, if I try to modify the original instance (not the unmanaged copy), I crash with an “Accessed from incorrect thread” error


(jay) #2

The question is a bit vague. If you have an unmanaged copy of an object, you can freely change it as it’s not persisted, along those same lines a persisted object can be changed within a write block.

Either way, we would need to see the code you’ve attempted and when/where the error occurs. Can you update with code so we can take a look?