无法pushViewController iOS [英] Unable to pushViewController iOS

查看:513
本文介绍了无法pushViewController iOS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用中使用了storyboard,:
我的查看,点击按钮我想导航到新的查看

I am using storyboard in my app, : I have Button in my View, On click of button i want to navigate to new View

但是当我点击按钮没有任何反应时,

But when i click on button nothing happens,

这是我的代码:

- (IBAction)JoinClicked:(id)sender{

    JoinWithViewController *detail_view_controller = [[JoinWithViewController alloc] initWithNibName:@"JoinWithViewController" bundle:nil];

    [self.navigationController pushViewController:detail_view_controller animated:YES];
}

我在做错了,请帮忙。

提前致谢。

推荐答案

设置视图控制器的故事板ID在身份检查员的故事板中

Set storyboard id of view controller in story board in identity inspector

参考你的故事板,如

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

然后到你的控制器

YourController *vc = [storyboard instantiateViewControllerWithIdentifier:@"YourController"];// storyboardId

[self.navigationController pushViewController:vc animated:YES];

你也可以制作segue并做

and you can also make segue and do

[self performSegueWithIdentifier:@"YourSegueIdentifier" sender:sender/nil];

这篇关于无法pushViewController iOS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆