<@UHAJKUSTU> In my iOS app (SwiftUI) the following...
# decompose
p
@Arkadii Ivanov In my iOS app (SwiftUI) the following occurs: I type some text into into a
TextField
, then click a button that saves my data and then pops the screen from
StackNavigation
to return back. Immediately after that the callback from
TextField
triggers the component one more time and calls a method that calls a
InstanceKeeper.Instance
subclass. But the
InstanceKeeperDispatcher
is destroyed at this point and the app crashes when trying to get the instance from it. What should I look into here to fix this behavior? Catching the exception thrown by
InstanceKeeperDispatcher
doesn’t seem to be a good idea
a
It sounds like you should save a reference to your instance in the component (in a private property). And then just use that property to access the instance, not InstanceKeeper.
p
Thanks!