我需要在我的单点触控应用程序中实现状态保存协议(protocol),如 Apple 文档中所述:
App State Preservation and Restoration
但我在 Xamarin 网站上找不到有关 UIViewControllerRestoration 协议(protocol)的任何文档或项目示例。
感谢任何帮助。
最佳答案
该协议(protocol)当前未在 MonoTouch 中绑定(bind)。这里有一个错误:
https://bugzilla.xamarin.com/show_bug.cgi?id=8778
也就是说,AppDelegate 中有一个类似的回调,application:viewControllerWithRestorationIdentifierPath:coder: 在 MonoTouch 中绑定(bind)到该方法:
UIViewController GetViewController(UIApplication应用程序,string[]restoreIdentifierComponents,NSCoder编码器)。
对于每个未设置恢复类的已保存 Controller ,这将被调用一次。因此,您可以在 App Delegate 中重写此方法来代替恢复类。
关于ios - MonoTouch 中应用程序状态的保存和恢复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12712469/