tags:

views:

20

answers:

1

I have a UIViewController as root vc, attached to the window. Then I simply created another VC and want it to appear modally. When I add this directly to the rootViewController, it is visible. But when I call

- (void)presentModalViewController:(UIViewController *)modalViewController animated:(BOOL)animated

nothing happens.

+1  A: 

Inside the vc do you go?

NewViewController *myNewViewController = [[NewViewController alloc] init];
[self presentModalViewController:myNewViewController animated:YES];
[myNewViewController release];
RickiG
sort of. I assign it to a retain property before I do that ;) and it's a tab bar controller. For some reason it does work only with plain normal UIViewController, but a UITabBarController won't show up modally.
dontWatchMyProfile
It does inherit from UIViewController… but it has no "view" property. The presentModalViewController probably looks for a [UIViewController view] property it can display. The UITabBarController has a [[[UITabBarController viewControllers] objectAtIndex:index] view] for its UIViewControllers that it displays.
RickiG
Wrap the UITabBarController in a UIViewController and present it like that.
RickiG
Makes sense! I think that was the problem. Thanks.
dontWatchMyProfile