工具栏后退按钮不起作用



我做一个项目使用故事板,在一个视图控制器我有一个按钮。当我点击,它将移动到下一个视图控制器,但它是一个单独的xib文件。现在我尝试添加后退按钮到xib文件,所以我可以回到我的故事板,但它不工作从我吗?

我尝试以下代码从xib移动到storyboard视图控制器

viewcontrollerOne *list= [self.storyboard instantiateViewControllerWithIdentifier:@"detail"];
[self presentModalViewController:list animated:YES];

请告诉我它不能工作的原因。

你可以尝试将你的项目更改为UINavigationController然后在storyboard中你可以链接视图

当你想在Storyboard中从xib移动到视图控制器时,这段代码将起作用,它为我工作。

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"IDENTIFIER"];
[self.navigationController pushViewController:vc animated:YES];

最新更新