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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:51:07+00:00 2026-05-27T03:51:07+00:00

as my title, how do i add in a rightbarbuttontiem in a specific view

  • 0

as my title, how do i add in a rightbarbuttontiem in a specific view of tabbarcontroller ?

i’m using storyboard to create the tabarcontroller.

i tried this but the item are not displayed

   UIBarButtonItem *settingButton = [[UIBarButtonItem alloc]  
                                  initWithImage:[UIImage imageNamed:@"gear.png"]  
                                  style:UIBarButtonItemStylePlain  
                                  target:self  
                                  action:@selector(pushToSetting)];  

//BarButtonItem *settingButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(insertNewObject)];
self.navigationItem.rightBarButtonItem = settingButton;
  • 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-27T03:51:08+00:00Added an answer on May 27, 2026 at 3:51 am

    Are you using a NavigationController? If you are, then your code should work. If you are using just a UINavigationBar, then you have to set the items property for the UINavigationBar. As you are not getting a rightbuttonitem, I assume you are using a UINavigationBar. This code should work:

    UIBarButtonItem *settingButton = [[UIBarButtonItem alloc] initWithTitle:@"Settings" style:UIBarButtonItemStylePlain target:self action:nil];
    UINavigationItem *navItem = [[UINavigationItem alloc] initWithTitle:@"Test"];
    navItem.rightBarButtonItem = settingButton;
    NSArray *navItems = [NSArray arrayWithObject:navItem];
    [self.navBar setItems:navItems];
    

    You should have the rightbarbuttonitem now. Here, navBar is a UINavigationBar outlet. You can also pop and push navigation items onto a UINavigationBar using these methods:

    • (void)pushNavigationItem:(UINavigationItem *)item animated:(BOOL)animated;
    • (UINavigationItem *)popNavigationItemAnimated:(BOOL)animated;
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to create the layout like this but not getting perfect. getting this
How can I add/overwrite the title and author metadata of a PDF using CAM::PDF
This question Add a version number to the title of a LaTeX document spurred
How to add value to this form.content before rendering class myform(forms.Form): title = forms.CharField(max_length
The title speaks for itself, but I would add some pointers I've noticed along
Based on this example (which works): var Comment = new Schema(); Comment.add({ title :
I have a chunk of code: for (game in settings_object.games) { chrome.contextMenus.create({ title: Add
As the title says: in sharepoint 2010 i need to programmatically create a view
I'm using a preDqlSelect() callback to add a virtual field. But the validation of
Typically views appear to output anchors without 'title' attributes. How would you add 'title'

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.