Xos*_*ose 11 storyboard uiview pushviewcontroller ios xcode4.5
我有这个代码
PlaceViewController *newView = [self.storyboard instantiateViewControllerWithIdentifier:@"PlaceView"];
[self presentViewController:newView animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
我可以更改视图,但是当我在此页面返回时,我会推动此视图,状态仍然存在.
我试着把这段代码:
[self.navigationController pushViewController:newView animated:YES];
Run Code Online (Sandbox Code Playgroud)
但什么也没做.
谢谢
Vin*_* TP 39
PlaceViewController *newView = [self.storyboard instantiateViewControllerWithIdentifier:@"storyBoardIdentifier"];
[self.navigationController pushViewController:newView animated:YES];
Run Code Online (Sandbox Code Playgroud)
检查2件事,
你的故事板标识符是正确的.
根视图有导航控制器.
对于情节提要,应该这样使用performSegueWithIdentifier:
[self performSegueWithIdentifier:@"identifier goes here" sender:self];
Run Code Online (Sandbox Code Playgroud)
小智 5
使用:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"STORYBOARD_NAME" bundle:nil];
PlaceViewController *newView = [storyboard instantiateViewControllerWithIdentifier:@"PlaceView"];
[self presentViewController:newView animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
要么:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"STORYBOARD_NAME" bundle:nil];
PlaceViewController *newView = [storyboard instantiateViewControllerWithIdentifier:@"PlaceView"];
[self.navigationController pushViewController:newView animated:YES];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
39661 次 |
| 最近记录: |