0

Hey guys, I recently trying to play with Navigation Controller and I'm facing some problems here would like to seek for help.

I opened a new project and using view-based application. After that I add a Navigation Controller from library then I build and run, why I can't see the navigation bar on the simulator? I only see a white view ...

Anyone know what's happened?

3 Answers 3

0

Given you did provide no context at all, this is difficult to answer. Even though, there's a good chance you forgot to add that navigation controller view to your window (should be in the AppDelegate applicationDidFinishLaunching):

UIWindow* mainWindow ...
UINavigationController* navigationController ...

[mainWindow setRootViewController:navigationController]

This can also be wired using Interface Builder.

3
  • Is it possible If I don't want use UIWindow? Because actually I'm using one navigation controller to call another one. Which means I'm using XIB 1's navigation controller to call (pushViewController) XIB 2.. but the navigation controller in XIB 2 didnt show up :(
    – Birdkingz
    Jul 24, 2010 at 8:12
  • There's always one (and no more) UIWindow in your application. Think of it as "the screen". Jul 24, 2010 at 8:29
  • I keep on switching between two view then my program crashed :( It's like now I'm from XIB 1 to XIB 2, then after that from XIB 2 to XIB 1, then again I'm from XIB 1 to XIB 2, it will crash. Is it because something I havent clean up? PhotoNotesViewController *photoNotesViewController = [[PhotoNotesViewController alloc] initWithNibName:@"PhotoNotesViewController" bundle: nil]; [mainViewController presentModalViewController:photoNotesViewController animated:NO]; [photoNotesViewController release]; // this is how I change the view from view 1 to view 2,from view 2 to view 1 i just call dismiss
    – Birdkingz
    Jul 24, 2010 at 11:15
0

I keep on switching between two view then my program crashed :( It's like now I'm from XIB 1 to XIB 2, then after that from XIB 2 to XIB 1, then again I'm from XIB 1 to XIB 2, it will crash.

Is it because something I havent clean up?

PhotoNotesViewController *photoNotesViewController = [[PhotoNotesViewController alloc] initWithNibName:@"PhotoNotesViewController" bundle: nil]; 
[mainViewController presentModalViewController:photoNotesViewController animated:NO]; [photoNotesViewController release]; 

// this is how I change the view from view 1 to view 2,from view 2 to view 1 i just call dismissModal

0

1st you have create the UINavigationController object like this.

UINavigationController* navigationController;

on the .h file than sys this .it will work

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.