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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:53:28+00:00 2026-05-17T18:53:28+00:00

I have a UINavigationController loading in the first tab of a UITabBarController . I’d

  • 0

I have a UINavigationController loading in the first tab of a UITabBarController. I’d like add a refresh button on the right side of the UINavigationItem. My dim understanding is that one has to set properties like titles and buttons on a nav controller before it’s added to the control hierarchy. I have no problem adding buttons to the child navigation controller, but I’m stumped by how to change the root, since it’s loading from the nib.

So in the IB screencap below (oops, not enough reputation points, let me try to diagram this….), I’m trying to add a refresh button to the selected item.

  • File’s Owner
  • First Responder
  • App Delegate
  • Window
  • Tab Bar Controller
    • Tab Bar
    • Observation List View Controller
      • Navigation Bar
      • View Controller
        • Table View
        • Navigation Item
      • Tab Bar Item
    • Another List View Controller
    • etc.
    • etc.

I’ve tried to add the button in the navigationController's viewDidLoad, with no help:

- (void)viewDidLoad {
[super viewDidLoad]; 

self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]
         initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
         target:self
             action:@selector(refresh:)];
}

I’ve also tried to programmatically add my ObservationListViewController to the UITabBarController, and insert the button in that block, but I’m way out of my depth.

Any idea how I could inject adding a button into the process of loading a nav controller from the nib?

Thank you!

  • 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-17T18:53:28+00:00Added an answer on May 17, 2026 at 6:53 pm

    It looks like your viewDidLoad method is allocating but not releasing the bar button item. you should do this:

    UIBarButtonItem *button = [[UIBarButtonItem alloc]
         initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
         target:self
             action:@selector(refresh:)];
    self.navigationItem.rightBarButtonItem = button;
    [button release];
    

    You need to do this not in the nav controller, but in the root view controller that’s contained within the navigation controller. In other words, put it in “View Controller” not “Observation List View Controller”

    Each controller you push onto the nav controller can have it’s own self.navigationItem.whatever and this will be displayed by the nav controller when the new controller is pushed onto its stack.

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

Sidebar

Related Questions

I have a UITabBarController that is loading a UINavigationController. When I push a new
I have a UINavigationController onto which I push a 'loading screen' UIViewController whilst I
I have a UINavigationController containing an UIViewController initialized with a UIView. The UINavigationController also
I have a UINavigationController. In its toolbar is a segmented control with two buttons.
I'm working on a simple iPhone app. I have 1 UINavigationController and 2 subclasses
I have an application with 5 UIViewController s each inside a corresponding UINavigationController ,
The issue: I have a UINavigationController as as subview of UIWindow, a rootViewController class
i am using a UINavigationController in my application. in the first view i am
I have a view controller managed in a UINavigationController. My view controller puts up
I have a UITabBar + UINavigationController application which often needs data from the internet.

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.