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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T05:07:17+00:00 2026-05-23T05:07:17+00:00

As this question [kind of] asks, how can I setup some toolbar items in

  • 0

As this question [kind of] asks, how can I setup some toolbar items in my MainWindow.xib and have those items present when I use the UINavigationController pushViewController:animated:.

For example, my application has:

  • MainWindow.xib, which contains a UINavigationController with navigation bar and a toolbar.
  • AViewController.xib, which just contains a UITableView.

At some point, our user presses a toolbar button and the associated action performs:

- (void)someAction {
    [self.navigationController pushViewController:[[AViewController alloc] 
        initWithNibName:nil bundle:nil] 
      animated:YES];
}

When the new view gets pushed, it contains a blank toolbar, instead of the toolbar with the same items as before. What’s the preferred method for keeping them the same? I feel like I’m just missing something simple! Thanks in advance!

  • 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-23T05:07:18+00:00Added an answer on May 23, 2026 at 5:07 am

    I would have one of my classes adopt the UINavigationControllerDelegate protocol and implement the navigationController:willShowViewController:animated: method like this,

    - (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
        [viewController setToolbarItems:toolbarItems animated:NO];
    }
    

    where I create and store toolbarItems in the delegate class. One of the likely candidates for being the delegate is the application delegate class as it is most probable place where you will instantiate the navigation controller.

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

Sidebar

Related Questions

Kind of like this question I have many text snippets that I use many,
This question is kind of related to another question but I have a specific
This question might be kind of elementary, but here goes: I have a SQL
This is similar to this question , but kind of the opposite. I have
This question is kind-of crappy because I try to get around some limitations: Current
This question kind of follows on froma previous one I posted. I have a
Maybe this question is kind of silly but I have no clue how to
Not even really sure what kind of title this question needs. Basically I have
This is kind of a followup to this question . I have the following
Yes, I know this question is kind of a mouthful of everything... 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.