James Kerstan
James Kerstan

Reputation: 323

Navigation Controller : pushViewController

I have a tab based application with a navigation controller in it.

When i click on the tab i get a tableview that works correctly.

When i click on a cell, it pushes the respective view by using the following line of code:

    [self.navigationController pushViewController:AJW animated:YES];

That pushes the second view which contains a button to a third view

the button is called upon by the following code:

- (IBAction)Map:(id)sender;
{
A_J_White_Park_Map *MAP =[[A_J_White_Park_Map alloc] initWithNibName:nil bundle:nil];
[self.navigationController pushViewController:MAP animated:YES];
} 

When i click this button it displays a view where the Navigation Bar(with back button) shows along with the tab bar, but where the NIB file should display its just black/blank.

I have linked up the IBAction in IB correctly and i have even tried the "presentModalViewController" method but I can't work out why the view has appeared black/blank.

I was wondering if anyone knew where my problem is and how to fix it?

Any help would be greatly appreciated.

Thanks

Upvotes: 1

Views: 1259

Answers (2)

ferdil
ferdil

Reputation: 1300

Are you sure you're supposed to be initializing your A_J_White_Park_Map class with a nil NIB? (it's not clear from your code whether you're initializing the A_J_White_Park_Map's view somewhere else)

Upvotes: 1

MadhavanRP
MadhavanRP

Reputation: 2830

When you alloc and init your A_J_White_Park_Map, you should provide a NIB file. IF the .xib file name you created in the interface builder is the same as the your class name, you could just alloc and init it without specifying nib name and bundle.

Upvotes: 4

Related Questions