Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-25-2010, 07:03 PM   #1 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 651
kapps11 is on a distinguished road
Default NavigationController missing back button

Hey guys -

so this seems like a really stupid problem that I should be able to fix but I cant figure it out for the life of me. So I'm just pushing a view controller onto a navigation controller, and that works fine, but THERES NO BACK BUTTON, and I cant figure out why because it usually puts on in for you. This may be something with the new iOS 4 stuff. but anyway ya any help would be great!!
kapps11 is offline   Reply With Quote
Old 06-25-2010, 07:07 PM   #2 (permalink)
CAM
Registered Member
 
Join Date: Feb 2009
Posts: 157
CAM is on a distinguished road
Default

Can you give us some code and tell us where you put the navigationController
CAM is offline   Reply With Quote
Old 06-25-2010, 07:09 PM   #3 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 651
kapps11 is on a distinguished road
Default

its just a basic nav controller with a table view that was setup by apple Navigation-Based app template. Then i just add the next view controller (ImageViewController is obviously a subclass of UIViewController):

Code:
ImageViewController *imageView = [[ImageViewController alloc] initWithEntry:[self.entryArray objectAtIndex:indexPath.row]];
[self.navigationController pushViewController:imageView animated:YES];
kapps11 is offline   Reply With Quote
Old 06-25-2010, 07:21 PM   #4 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 651
kapps11 is on a distinguished road
Default

Nvm i figured it out, or fixed it anyway. I guess the way that apple sets it up, the navigation controller doesnt get a rootview controller, so when you try to puch your first one, it sets that as the root, therefore there is no back button. So in the app delegate, setting your root view controller as the view controller for it fixes the problem:"

Code:
navigationController = [[UINavigationController alloc] initWithRootViewController:[[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil]];
kapps11 is offline   Reply With Quote
Old 06-25-2010, 07:22 PM   #5 (permalink)
CAM
Registered Member
 
Join Date: Feb 2009
Posts: 157
CAM is on a distinguished road
Default

ok
CAM is offline   Reply With Quote
Old 09-06-2010, 05:10 AM   #6 (permalink)
Registered Member
 
Join Date: Aug 2009
Posts: 105
vamsi.ac is on a distinguished road
Default

Quote:
Originally Posted by kapps11 View Post
Nvm i figured it out, or fixed it anyway. I guess the way that apple sets it up, the navigation controller doesnt get a rootview controller, so when you try to puch your first one, it sets that as the root, therefore there is no back button. So in the app delegate, setting your root view controller as the view controller for it fixes the problem:"

Code:
navigationController = [[UINavigationController alloc] initWithRootViewController:[[RootViewController alloc] initWithNibName:@"RootViewController" bundle:nil]];
thank you,,, worked for me too..
vamsi.ac is offline   Reply With Quote
Old 01-22-2011, 04:32 PM   #7 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 1
jpaulorio is on a distinguished road
Default Another Option without code

Instead of writing code you may also open the MainWindow.xib file in Interface Builder, select the Navigation Controller in the list which contains File's Owner, First Responder, etc, and in the Inspector on the View Controller Group select RootViewController for the NIB Name field. Then expand the Navigation Controller item until you find the "Navigation Item" item. Select it and in the Inspector fill the Title field. When you run your app you'll see a back button with the text you've typed in the Navigation Item's title field.
jpaulorio is offline   Reply With Quote
Old 02-25-2011, 09:57 AM   #8 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 1
papaB is on a distinguished road
Default missing step in book

Quote:
Originally Posted by jpaulorio View Post
Instead of writing code you may also open the MainWindow.xib file in Interface Builder, select the Navigation Controller in the list which contains File's Owner, First Responder, etc, and in the Inspector on the View Controller Group select RootViewController for the NIB Name field. Then expand the Navigation Controller item until you find the "Navigation Item" item. Select it and in the Inspector fill the Title field. When you run your app you'll see a back button with the text you've typed in the Navigation Item's title field.
Thanks! worked for me as well, I am working through Head First Iphone Development and it is a great book. Except it is still using iOS sdk 3.0 and an example uses Twitter API's basic authentication, which is deprecated.

But this was the missing step. Thanks again!
papaB is offline   Reply With Quote
Reply

Bookmarks

Tags
back, button, controller, navigation, navigationcontroller

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 328
7 members and 321 guests
anothermine, Chickenrig, Domele, givensur, michaelhansen, PixelInteractive, Sloshmonster
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,892
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:22 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0