presentModalViewController from tab bar in storyboard
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];
}
}
精彩评论