我试图通过编程
点击uibutton事件移动到另一个secondviewcontroller
(IBAction)button:(id)sender
{
UIViewController *homecon=[[UIViewController alloc]initWithNibName:@"loginscreen" bundle:NULL];
[self segueForUnwindingToViewController:homecon fromViewController:homecon identifier:@"loginscreen"];
[self.navigationController pushViewController:homecon animated:YES];
}
答案 0 :(得分:1)
如果您在导航控制器
中,请尝试使用此选项(IBAction)button:(id)sender
{
ViewController *viewController = [[UIViewController alloc]initWithNibName:@"loginscreen" bundle:NULL];
[self.navigationController pushViewController:viewController animated:YES];
}
否则只是这个
(IBAction)button:(id)sender
{
ViewController *viewController = [[UIViewController alloc]initWithNibName:@"loginscreen" bundle:NULL];
[self presentViewController:viewController animated:YES completion:nil];
}