问题
I am using MvvmCross v3.5 to build an iOS application. Whenever the application goes into the background I am expecteing SaveState to be called in the view model.
However it never gets called. I have tried this both on the simulator and a device. Am I missing something.
This works in the Android version of the app, so I think I have set it up correctly.
Has anyone else got this issue? Any help would be appreciated.
回答1:
I think in Xamarin you need to implement UIApplicationDelegate.ShouldRestoreApplicationState and ShouldSaveApplicationState to return true.
来源:https://stackoverflow.com/questions/29901027/savestate-in-mvvmcross-is-not-being-called-in-an-ios-application