1

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

2
  • Are you sure you're supposed to be initializing your A_J_White_Park_Map class with a nil NIB ? (its not clear from your code wether you're initializing the A_J_White_Park_Map's view somewhere else) Commented Nov 7, 2011 at 7:39
  • Thank you so much, That has fixed the problem. I guess should pay more attention to my code lol. Commented Nov 7, 2011 at 8:10

2 Answers 2

4

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you so much, That has fixed the problem. I guess should pay more attention to my code lol.
1

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)

2 Comments

Hi, Unfortunately i cannot up vote it test because i only have a reputation of ten. when i get 15 i will straight away. sorry
No worries. Welcome to StackOverflow - it's an awesome place FULL of knowledge !!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.