我有这个代码
PlaceViewController *newView = [self.storyboard instantiateViewControllerWithIdentifier:@"PlaceView"];
[self presentViewController:newView animated:YES completion:nil];
我可以更改视图,但我会推送此视图,因为当我返回此页面时,状态仍然存在。
我尝试输入这段代码:
[self.navigationController pushViewController:newView animated:YES];
但什么也没做。
Thanks
Objective-C:
PlaceViewController *newView = [self.storyboard instantiateViewControllerWithIdentifier:@"storyBoardIdentifier"];
[self.navigationController pushViewController:newView animated:YES];
请注意以下几点,
您的故事板标识符是正确的。
根视图有导航控制器。
Swift:
let newView = self.storyboard?.instantiateViewController(withIdentifier: "storyBoardIdentifier") as! PlaceViewController
self.navigationController?.pushViewController(newView, animated: true)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)