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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:18:40+00:00 2026-06-11T18:18:40+00:00

I’m having problems displaying the rightBarButtonItem of the Navigation Bar – I’m attempting to

  • 0

I’m having problems displaying the rightBarButtonItem of the Navigation Bar – I’m attempting to create it programmatically in the Application Delegate, where my UINavigationController is set up.

Code is as follows:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

// Override point for customization after application launch.
RSCListViewController *list = [[RSCListViewController alloc] initWithStyle:UITableViewStylePlain];
self.navController = [[UINavigationController alloc] initWithRootViewController:list];

UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithTitle:@"+"
                                                              style:UIBarButtonItemStylePlain
                                                             target:list
                                                             action:@selector(addPressed:)];

self.navController.navigationItem.rightBarButtonItem = barButton;

self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];

[DatabaseManager openDatabase];

return YES;
}

Running the application, no button item appears on the navigation bar.

I’m not sure whether I have missed something obvious – my attempts to rectify the problem using related Stack Overflow threads haven’t yielded any success.

Any help appreciated.

  • 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-11T18:18:41+00:00Added an answer on June 11, 2026 at 6:18 pm

    You need to attach your bar button item to your custom view controller, not to the navigation controller. From Updating the Navigation Bar:

    In addition, the navigation controller object builds the contents of
    the navigation bar dynamically using the navigation items (instances
    of the UINavigationItem class) associated with the view controllers on
    the navigation stack. To change the contents of the navigation bar,
    you must therefore configure the navigation items for your custom view
    controllers.

    (…)

    The navigation controller updates the right side of the navigation bar
    as follows:

    • If the new top-level view controller has a custom right bar button item, that item is displayed. To specify a custom right bar button
      item, set the rightBarButtonItem property of the view controller’s
      navigation item.

    • If no custom right bar button item is specified, the navigation bar displays nothing on the right side of the bar.

    Therefore, replace:

    self.navController.navigationItem.rightBarButtonItem = barButton;
    

    with:

    list.navigationItem.rightBarButtonItem = barButton;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to create an if statement in PHP that prevents a single post
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and

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.