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 5990479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:14:59+00:00 2026-05-22T23:14:59+00:00

So I created a UINavigationController manually, set it as my UIWindow’s rootViewController, and I

  • 0

So I created a UINavigationController manually, set it as my UIWindow’s rootViewController, and I would like to use a back button to exit the UINavigationController and load another viewController in its place. However, the backItem property of the UINavigationBar is readonly, so I don’t know how to set it properly (it is readonly and defaults to nil in the root navigation view). How can I achieve this (or similar effect, I want to be able to effectively “exit” this UINavigationController by pressing the back button on the root view).

Alternatively, is this bad form? How should I escape the root view of a UINavigationController?

EDIT:

Attempted Legolas’ solution with the following code: (some names have been changed)

UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:plvc]; // plvc being the first viewcontroller
MyAppDelegate* appDelegate = [Utility getAppDelegate];
appDelegate.window.rootViewController = navController;

UIBarButtonItem* backButton = [[UIBarButtonItem alloc] initWithTitle:@"Start" style:UIBarButtonItemStyleBordered target:self action:@selector(initializeStuff)];
navController.navigationItem.leftBarButtonItem = backButton;
[navController.navigationItem setHidesBackButton:YES animated:YES];
[navController.view setNeedsDisplay];

But the button does not display. What am I doing wrong? The other back buttons display properly, but this one still does not.

  • 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-05-22T23:15:00+00:00Added an answer on May 22, 2026 at 11:15 pm

    You can do this in a different approach.

    Go to the method:

    - (void)viewDidLoad
    

    Hide the back button with

    [self.navigationItem setHidesBackButton:YES animated:YES];
    

    Create a new UIButton or a UIBarButtonItem, and place it in place of the back button.

    You can then use an action when you click the button

    - (IBAction) clickBackButton : (id) sender; //and push view controller to your required view.
    

    Updating my answer: Use this in the viewDidLoad method //works like a charm //

    [self.navigationItem setHidesBackButton:YES animated:YES];
    UIBarButtonItem* backButton = [[UIBarButtonItem alloc] initWithTitle:@"Start" style:UIBarButtonItemStyleBordered target:self action:@selector(initializeStuff)];
    
    self.navigationItem.leftBarButtonItem = backButton;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created UITabBarController with each tab contain UINavigationController and set rootviewcontroller in this UINavigationController
So I have this iPhone app with a nested setup like this: [RootViewController]->[UITabBarController]->[UINavigationController]->[subViewControllers]. Everything
Like many other developers out there, I've created iPhone projects that use a UITabBarController
I have a UINavigationController (to use like a wizard page) which I create programmatically
In my application, I have a UINavigationController with a UINavigationBar that I created programmatically.
Okay so I am trying to use a simple UINavigationController with iPhone SDK in
I have a my views and controllers set up like so. A Tab/Bar controller
I am using a UINavigationController to slide from a UITableViewController to another view. In
I'd love to create a back left-arrow-bezel button in a UIToolbar . As far
I want to show a Now Playing button in a UINavigationController's bar. I have

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.