From tutorials like this , I know that I need to set the RestorationIdentifier
and RestorationClass
on my view controllers in order to get state restoration to work without storyboards, but I can't figure out how to set the RestorationClass
in my view controller.
Objective-C examples do self.RestorationClass = [self class]
, but my attempted C# translation RestorationClass = this
produces the error Cannot implicitly convert type Foo
to ObjCRuntime.Class
. How do I work around this error?
您可能需要这样的代码来为 Type 创建一个 Class 对象:
this.RestorationClass = new ObjCRuntime.Class(typeof(BViewController));
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.