Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8011919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:09:54+00:00 2026-06-04T19:09:54+00:00

This is what xcode does by default: WHen you are viewing the first view

  • 0

This is what xcode does by default: WHen you are viewing the first view in a navigation controller, the “back” button does not appear in the header. The back button only appears when you travel to another view instantiated by the first view.

I want a home button, or back button to appear while you are on the first view. Clicking on it will perform a certain action….like say change the rootviewcontroller. How can I get this button to appear and how do I override it’s behaviour only when on the first view? The behaviour of the backbutton should work as default when on any other view.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:09:57+00:00Added an answer on June 4, 2026 at 7:09 pm

    In your root view controller’s viewDidLoad method, initialize a UIBarButtonItem and add it to the navigation controller’s toolbar:

    UIBarButtonItem *homeButton = [[UIBarButtonItem alloc]
                                  initWithTitle:@"Home"
                                  target:[AppDelegate sharedDelegate]
                                  action:@selector(changeRootViewController)];
    [self.navigationItem setLeftBarButton:homeButton animated:NO];
    

    The target should be your application delegate class if you want to swap out root view controllers. Create a method in that class called changeRootViewController to perform the view controller swap.

    You can change the homeButton to use an image instead of text using initWithImage:.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why does Xcode not allow this: UILabel*redlabel,greenlable,bluelabel; But likes this: UILabel*redlabel; UILabel*greenlabel; UILabel*bluelabel; You
This is not an actual Xcode error message, it is a warning that has
So, create a vanilla project, build & run... App does not appear. Open console:
I got this error from XCode: objc[8422]: FREED(id): message release sent to freed object=0x3b120c0
I got this code and XCode warns me of "incompatible pointer types initializing NSString
Why do I get this warning in Xcode 4.3.1? Thanks.
i am using PhoneGap,n using this code in xCode then run properly and database
From times to times, while debugging an Application, I see this error on Xcode:
This is Objective-C, in Xcode for the iPhone. I have a method in main.m:
This has been annoying me for a while in several XCode projects. I really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.