1
votes

I have a tab bar controller and when loading the tab bar controller what I want to do is to load a registration page. Here is my code for this.

    RegistrationScreen *registrationScreen = [[RegistrationScreen alloc] initWithNibName:@"RegistrationScreen" bundle:nil];
    [self.tabBarController presentModalViewController:registrationScreen animated:FALSE];       
    [registrationScreen release];

This works fine. But in my registration page i have a another view which is a read me. I need to load this as another modal view once you click a link in the registration page. However this not triggered. What am I doing wrong here? What should I do to load multiple views on top of tab bar controller?

Thank you

2
You should really quote the code that is not working if you want to know what you are doing wrong.Till

2 Answers

3
votes

Since RegistrationScreen is a modal view controller, it shouldn't have self.tabBarController or self.navigationController. You can check yourself with NSLog or similar.

It should have self.parentViewController.

inside RegistrationScreen.m try:

[self.parentViewController.tabBarController presentModalViewController:xxxx]

or

[self presentModalViewController:xxxx]

depending on how your flow works.

0
votes

TabBarController is declared in AppDelegate file. But I don't know how to use this to present modal view in one of the tab bar viewControllers? [self.parentViewController.tabBarController presentModalViewController:xxxx]

My source code link is here