1
votes

In my application the modal navigationcontroller that I am presenting is going under the current navigationcontroller so I'm not able to view the new navigationbar as it's disappearing under the current one.

I'm presenting the modalview on self and not self.navigationcontroller because self.navigationcontroller doesn't present the modalviewcontroller.

Also how to push a view on this modal navigationcontroller?

I'm using following code in one of my viewControllers:

fullListTopCompanies *fullListTopCompaniesInstance = [[fullListTopCompanies alloc] initWithNibName:@"fullListTopCompanies" bundle:nil];

UINavigationController *navigationController = [[UINavigationController alloc]

                                                initWithRootViewController:fullListTopCompaniesInstance];

fullListTopCompaniesInstance.navigationController.navigationItem.title = @"F";
[self presentModalViewController:navigationController animated:YES];


[navigationController release];

[fullListTopCompaniesInstance release];

Can anybody please help?

Thanx in advance.

3

3 Answers

0
votes

use animated with transition

according to me you have to change the animation style

i done it before but forgot the code i will post it when i get it

0
votes
self.navigationController.navigationItem.title = @"F";

Add the above line of code in viewDidLoad method of "fullListTopCompanies" class.

-1
votes

Actually your navigation bar hides because of the modal view and modal view by default doesnt have Navigation bar.To add a navigation bar to modal view you can try the below code:

In Header File

IBOutlet fullListTopCompanies *fullListTopCompaniesInstance;

In Implementation File

UINavigationController *nav = [[UINavigationController alloc] initWithNibName:@"fullListTopCompanies" bundle:nil];

[self presentModalViewController:nav animated:YES];

[nav release];

Also on the "fullListTopCompanies" View Controller dont forget to put a left navigation bar button item for dismissing the modal view.

So add that left bar button (Ideally Cancel Button on navigation bar) and event handler for that left barr button should contain the code

[self dismissModalViewControllerAnimated:YES];

Hope this helps.