ios - MonoTouch 中应用程序状态的保存和恢复

标签 ios xamarin.ios

我需要在我的单点触控应用程序中实现状态保存协议(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/

相关文章:

ios - Swift:将 UIButton 转换为 UIBarButtonItem,真的需要这么复杂吗?

ios - MvxViewModelRequest 在 ViewDidLoad 中为 null

c# - MonoTouch.Dialog 中的图像或视频附件字段

ios - 自定义 UITableViewCell 不起作用

ios - 当您为应用程序编写 UI 代码时,哪些工具可以帮助 Xcode 减少构建和运行的频率

ios - 使用 objective-c 滑过菜单

xamarin.ios - Monotouch.Dialog iOS 7 自动外观升级?

c# - View 已添加到 UIViewControllerWrapperView,但显示不正确

powershell - 在安装在 Mac 上的 VSTS 代理中运行 powershell 构建步骤?

ios - 如何在 Swift 中将大于 Int.max 的浮点值转换为 Int