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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T17:09:56+00:00 2026-05-17T17:09:56+00:00

I am wondering why my UINavigationController is not letting me set a title. It

  • 0

I am wondering why my UINavigationController is not letting me set a title. It lets me change the tint of the navigationBar, but the title and rightBarButtonItem I set just get ignored. Why?

Here’s my code:

  taps = 0;

  UIView*controllerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];

  controllerView.backgroundColor = [UIColor whiteColor];

  controller = [[UIViewController alloc] init];

  [controller setView:controllerView];

  [controllerView release];

  navController = [[UINavigationController alloc] initWithRootViewController:controller];

  navController.navigationBar.barStyle = 1;

  navController.navigationItem.title = @"Setup";

  UIBarButtonItem*item = [[UIBarButtonItem alloc] initWithTitle:@"Done" style:UIBarButtonSystemItemDone target:self action:@selector(dismissSetup:)];

  navController.navigationItem.rightBarButtonItem = item;

  [item release];

  [self presentModalViewController:navController animated:YES];

  [mp stop];

p.s: I know i’m not releasing some of the stuff I alloc’ed, I do that later!

  • 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-17T17:09:56+00:00Added an answer on May 17, 2026 at 5:09 pm

    The navigation controller updates the
    middle of the navigation bar as
    follows:
    If the new top-level view controller has a custom title view,
    the navigation bar displays that view
    in place of the default title view.
    To specify a custom title view, set
    the titleView property of the view
    controller’s navigation item.
    If no custom title view is set, the navigation bar displays a
    label containing the view
    controller’s default title. The string
    for this label is usually obtained
    from the title property of the view
    controller itself. If you want to
    display a different title than the one
    associated with the

    view controller, set the title
    property of the view controller’s
    navigation item instead.

    You want your UINavigationController to change its title depending on which viewcontroller is currently on top. So the way to go is to set the title in the viewcontrollers you are pushing onto the viewControllers array.

    And by the way: I don’t think navigationcontrollers are supposed to be presented modally:

    Because the UINavigationController
    class inherits from the
    UIViewController class, navigation
    controllers have their own view that
    is accessible through the view
    property. When deploying a navigation
    interface, you must install this view
    as the root of whatever view hierarchy
    you are creating. For example, if you
    are deploying the navigation interface
    by itself, you would make this view
    the main subview of your window. To
    install a navigation interface inside
    a tab bar interface, you would install
    the navigation controller’s view as
    the root view of the appropriate tab.

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

Sidebar

Related Questions

Wondering if there is any way to get the lambda expressions that result from
I was wondering how can declare a custom UINavigationController in Xcode 4.2 ? I
I have a UINavigationController, and I was wondering how I can programmatically tell when
I'm just wondering if its at all possible to add a UIButton or and
I'm wondering how can I initialize a UINavigationController in order to display the third
Wondering if anyone knew how to get meta_search's sort_link to work with will_paginate? will_paginate
Wondering if anyone can help me with this annoying but trivial (in terms of
Wondering if there's any not-too-hard way to edit non-form text in html 4. I
I think the answer to my question is Yes, but i just would like
Wondering if I'm going about this the right way or not. I have 3

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.