[英]Pushing to viewController from appDelegate monoTouch
I am trying to setup a Getting started viewController. 我正在尝试设置一个入门的viewController。 In the appDelegate I want to create a if condition that checks for a NSUserDefaults Like this: 在appDelegate中,我想创建一个if条件来检查NSUserDefaults,如下所示:
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
if (NSUserDefaults.StandardUserDefaults.StringForKey ("LaunchWatcher") != null) {
} else {
}
return true;
}
If LaunchWatcher is not null, appDelegate should push to NewTrackTraceViewController. 如果LaunchWatcher不为null,则appDelegate应该推送到NewTrackTraceViewController。 If null then to TrackTraceViewController. 如果为null,则为TrackTraceViewController。 How can I do this using C#? 如何使用C#做到这一点? What would be the correct code to push to the viewcontroller? 推送到ViewController的正确代码是什么?
Something like this: 像这样:
if (NSUserDefaults.StandardUserDefaults.StringForKey ("LaunchWatcher") != null) {
this.PresentViewController(NewTrackTraceViewController, animated, null);
} else {
this.PresentViewController(TrackTraceViewController, animated, null);
}
您必须先构造视图控制器,然后再导航控制器,并将其分配给窗口。
Take a look here: 在这里看看:
Monotouch navigate from splash screen Monotouch从初始屏幕导航
Its basicly what you have to do. 基本上是您必须要做的。 Just use the topviewcontroller. 只需使用topviewcontroller。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.