开发者

presentModalViewController from tab bar in storyboard

开发者 https://www.devze.com 2023-04-13 04:54 出处:网络
I am doing the f开发者_开发知识库ollowing in viewDidAppear: SettingsViewController *svc = [[SettingsViewController alloc]init];

I am doing the f开发者_开发知识库ollowing in viewDidAppear:

SettingsViewController *svc = [[SettingsViewController alloc]init];   
[self presentModalViewController:svc animated:YES];

It appears to do something, but it doesn't seem to put the view controller on top.

In my storyboard I have one tab view which launches and I verified the method is being called, but the view controller doesn't display as it should. Do I have to hook up this view controller some how in the storyboard?


That's because the storyboard doesn't accept the orders you're giving to your Navigation Controller. Try this:

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([[segue identifier] isEqualToString:@"SettingsViewController"]) {
    [segue destinationViewController];
    }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消