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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:59:11+00:00 2026-06-09T12:59:11+00:00

hi im developing an ios aplication and the ui was desigbed using the storyboard

  • 0

hi im developing an ios aplication and the ui was desigbed using the storyboard (first time using it) so i have the folowing:

  • entry point: navigation Controller
  • rootView view controller (push to many other view some of one are UITableView)
  • and then i programatically push (in some controllers) a view loaded from a nib (no problem on this)

each controller has a defined title.

what i want to do is put a rigth button on the nav bar of all view controller so i can push (programatically) to another controller (wish is in a nib, but i coul move it to the SB whit no problem)

i have tried:

  • using a custom class and an nib file but i get the same uncustumised nav bar
  • overwriting initWithCoder so i can redirect it to de nib file but get an infinite loop (StakOverflow, yay!)
  • using a second class to avoid the infinite loop but get an exception:

    Terminating app due to uncaught exception ‘NSGenericException’, reason: ‘This coder requires that replaced objects be returned from initWithCoder:

  • add the button manually in the init method of the navbar class, no efect

  • replace the navigation bar in the navigation controller initWithCoder, no efect
  • same but in the viewDidLoad method of the navigation controller, no efect
  • same but in the rootView Controller, no efect

the code i was using was this (and a few variations):

UIBarButtonItem *BTN = [[UIBarButtonItem alloc] 
      initWithImage:[[UIImage alloc] initWithContentsOfFile:@"img.png"] 
      style:UIBarButtonItemStyleBordered 
      target:self 
      action:@selector(pushView)];

[[self navigationItem] setRightBarButtonItem:BTN];

is ther any way that i can archive this, or should i do it manually view per view?

–thanks

  • 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-09T12:59:12+00:00Added an answer on June 9, 2026 at 12:59 pm

    Yes, you would need to do in each view controller for it’s navigationItem property. But you can make it easier by creating a category on UIBarButtonItem class which will have a method configuring and returning the button you need everywhere.
    So you only need to invoke that category’s method and no need to write same code everywhere.

    Here are some similar posts:

    Adding same button to all view controllers in UINavigationController

    Adding UIBarButtonItem to all Navigation View Controllers inside a UITabBarController programmatically

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

Sidebar

Related Questions

I am developing an iOS Application and am using github for the first time,
I am new to ios developing. I have using a camera option in my
I'm developing an iOS 4 application using latest SDK and XCode 4.2. I have
I'm developing an iOS application using Core Data. I want to have the persistent
First of all, sorry for my English... I'm developing an iOS application that has
I'm developing an iOS 4 application with latest SDK and XCode 4.2. I'm using
I'm developing an iOS 4 application. I have this ViewController: @interface BlogViewController : UIViewController
I'm developing an iOS 4 application. I have a main view that contains another
I'm developing an iOS 4 with latest SDK and XCode 4.2 (I'm not using
I'm developing a large scale application for iOS 5 using ARC in xcode. The

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.