【发布时间】:2017-07-30 19:00:42
【问题描述】:
我有以下代码从导航控制器启动密码视图控制器。除了第一次启动应用程序之外,此代码每次都有效。因此,应用程序在启动时不会显示锁定屏幕。在每个睡眠模式启动后,都会显示密码 VC。我发现当应用程序启动时 loadView 和 viewwillappear 没有被第一次调用。对此的任何帮助表示赞赏。代码如下:
_passcodeViewController = [[KKPasscodeViewController alloc] initWithNibName:nil bundle:nil];
_passcodeViewController.mode = KKPasscodeModeEnter;
_passcodeViewController.hideCancel = YES;
_passcodeViewController.delegate = self;
_passcodeViewController.edgesForExtendedLayout = UIRectEdgeNone;
_passcodeViewController.isLaunchingVideoCall = isLaunchingVideoCall;
_passcodeCompletion = nil;
_passcodeNavController = [[UINavigationController alloc] initWithRootViewController:_passcodeViewController];
UINavigationController* rootNav = (UINavigationController*)self.window.rootViewController;
[rootNav presentViewController:_passcodeNavController animated:YES completion:nil];
【问题讨论】:
-
你在哪里运行展示 VC 的代码?
-
您发布的这段代码...在哪个函数中?
-
我在 applicationWillFinishLaunchingWithOptions 中运行代码。基本上我调用了一个运行这段代码的函数。
标签: ios objective-c uiviewcontroller