0

I know there are few questions about it but none of them was answered.

I have a navigation controller in my app. Pushing views works normally. After pushing, back button is also viewable but when i press the back button it does not pops the view, only changes the navigation bar's view to the preview's views navigation bar.

Hope someone has an answer now.

Thanks in advance.

xenep
  • 3,375
  • 4
  • 20
  • 19

2 Answers2

0

Can you provide some code snippets of where you push things? You should be pushing view controllers, not views.

UINavigationController is a view controller container essentially which manages a stack of view controllers. Each view controller contains a view.

Albert Tong
  • 411
  • 3
  • 5
  • I meant view controller. here is the code to push: RestaurantListerControler *restaurantListerControler = [[RestaurantListerControler alloc] initWithNibName:@"RestaurantListerView" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:restaurantListerControler animated:YES]; [restaurantListerControler release]; – xenep Nov 09 '10 at 08:37
0

I just spent three hours solving this issue. More than likely your Navigation Controller in the xib is messed up and the bar is not "connecting" to the application.

So, in IB, delete the existing Navigation Controller, and add a fresh one from the Library. Ctrl-drag from the Delegate (NOT the File's Owner) and drop onto the new Navigation Conroller, and select the delegate's outlet (you usually call it navController or navigationController). Then apple-4 and change the Class of the underlying View Controller (Root View Controller) to the name of the main View Controller. If that view controller has a nib/xib, specify it by pressing apple-1 and choosing the NIB. Again, this is for the View Controller, not the (parent) Navigation Controller. Save and re-build.

PapaSmurf
  • 2,345
  • 1
  • 20
  • 10