Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/104.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何推送至视图控制器表单_Ios_Objective C_Xcode_Xib_Pushviewcontroller - Fatal编程技术网

Ios 如何推送至视图控制器表单

Ios 如何推送至视图控制器表单,ios,objective-c,xcode,xib,pushviewcontroller,Ios,Objective C,Xcode,Xib,Pushviewcontroller,我有密码的xib,在我点击登录按钮后,将有web服务调用,在成功响应后,我必须提供密码的xib。 当我完成该部分时,我必须从显示的xib推送到另一个视图控制器 这是我的密码: [self dismissViewControllerAnimated:NO completion:^{ if ([_delegate respondsToSelector:@selector(unlockWasSuccessfulLockScreenViewController:pincode:)]) {

我有密码的xib,在我点击登录按钮后,将有web服务调用,在成功响应后,我必须提供密码的xib。
当我完成该部分时,我必须从显示的xib推送到另一个视图控制器

这是我的密码:

[self dismissViewControllerAnimated:NO completion:^{
    if ([_delegate respondsToSelector:@selector(unlockWasSuccessfulLockScreenViewController:pincode:)]) {
        [_delegate unlockWasSuccessfulLockScreenViewController:self pincode:pincode];

        PassCodeVC *sgn = [self.storyboard instantiateViewControllerWithIdentifier:@"PassCodeVC"];
        UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:sgn];

        [nav pushViewController:sgn animated:YES];

    }
    }];
我已经介绍了xib如下:

 JKLLockScreenViewController * viewController = [[JKLLockScreenViewController alloc] initWithNibName:NSStringFromClass([JKLLockScreenViewController class]) bundle:nil];
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:viewController];

[viewController setLockScreenMode:LockScreenModeNew];    // enum { LockScreenModeNormal, LockScreenModeNew, LockScreenModeChange }
[viewController setDelegate:self];
[viewController setDataSource:self];
[viewController setTintColor:[UIColor colorWithRed:53.0 / 255.0 green:115.0 / 255.0  blue:157.0 /255.0  alpha:1]];

[self presentViewController:nav animated:YES completion:nil];

如果您希望使用当前导航,只需使用当前导航控制器简单地传递新控制器即可

PassCodeVC *sgn = [self.storyboard instantiateViewControllerWithIdentifier:@"PassCodeVC"];
[self.navigationController pushViewController:childViewController animated:YES];

如果您希望使用当前导航,只需使用当前导航控制器简单地传递新控制器即可

PassCodeVC *sgn = [self.storyboard instantiateViewControllerWithIdentifier:@"PassCodeVC"];
[self.navigationController pushViewController:childViewController animated:YES];

您可能需要设置试图加载的视图控制器的情节提要ID。它位于inspector中,就在您为视图控制器分配自定义类的下方。

您可能需要设置要加载的视图控制器的情节提要ID。它位于inspector中,就在您为视图控制器分配自定义类的下方。

我已经这样做了,但它说您在导航控制器集情节提要中传递了nil值,如下所示:UIStoryboard*情节提要=[UIStoryboard StoryBoard with name:@“MainStoryboard”bundle:[NSBundle mainBundle]]; PassCodeVC*sgn=[情节提要实例化eviewController标识符:@“PassCodeVC”];还要检查情节提要ID是否已设置?我已设置,但它表示您正在导航控制器设置情节提要中传递nil值,如下所示:UIStoryboard*情节提要=[UIStoryboard StoryBoard with name:@“Mainstryboard”bundle:[NSBundle mainBundle];PassCodeVC*sgn=[情节提要实例化eviewController标识符:@“PassCodeVC”];还要检查情节提要ID是否已设置?
PassCodeVC *sgn = [self.storyboard instantiateViewControllerWithIdentifier:@"PassCodeVC"];
[self.navigationController pushViewController:childViewController animated:YES];