-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deallocated variable when trying to resolve object #516
Comments
Nothing has a strong reference to the view model - I think if you want it to persist beyond that scope you'll need a strong reference (somewhere). I think it's more common that the VC has the model injected into it (as opposed to the other way around) so that you then use the VC by inserting it into the navigation, and creating a strong reference that way |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Im trying to resolve viewModel in my MVVM architecture
My assembly class
Trying to resolve this way
let vm = assembler?.resolver.resolve(CancelViewModelProtocol.self, arguments: strongRouter, order, index) as? CancelViewModel
When I resolve it first time all is working correctly
But second time it gives me nil in viewModel.viewController
I checked that my CancelViewController deinited after 'return viewModel', but in first time it is ok.
viewModel has weak reference to viewController
and viewController has strong reference to viewModel
What am I doing wrong?
The text was updated successfully, but these errors were encountered: