interactor.login(trigram: trigram) is a kotlin nat...
# kotlin-native
m
interactor.login(trigram: trigram) is a kotlin native function My problem is when i reach that code i get a weird error illegal attempt to access non-shared login.LoginInteractor@16f8b08 from other thread Anyone can help?
s
It's a threading issue. You either need to use the main queue or freeze the objects you're sending into the global queue.
m
Hello @Sam, i’ve tried to use @SharedImmutable inside my kotlin native code for all my objects but still the same error
s
Try freezing the closure you're sending to the dispatch queue before sending it.
m
Ok thank you, i will try tomorow and tell you it works
Hello back from testing, couldn't find a way to make it work 😕 my code in shared module looks like this:
i tried to use .freeze everywhere same result maybe the problem is on the ios side
init { this.freeze() } inside my kotlin native class did the trick