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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:06:44+00:00 2026-06-03T13:06:44+00:00

In my iPhone project, I have a navigation view controller. In each view that

  • 0

In my iPhone project, I have a navigation view controller. In each view that is loaded by this controller, I am setting buttons in the UINavigationBar that are doing different things for each view.

However, I want to have the .rightBarButtonItem do exactly the same thing each time (namely, pop up a UIActionSheet). How can I centralize this code and not have to put it in every view controller?

I tried subclassing UINavigationController and setting the .rightBarButtonItem in this subclass’ viewDidLoad. However, no button is displayed then. (But when I put the same code in a view controller loaded by the navigation controller, the button is displayed and works fine).

The code I am using to set the rightBarButtonItem is:

self.navigationItem.rightBarButtonItem = ...
  • 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-03T13:06:46+00:00Added an answer on June 3, 2026 at 1:06 pm

    Subclass all the UIViewControllers that are pushed onto that UINavigationController and add the same viewDidLoad code.

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

Sidebar

Related Questions

I have a small iPhone Project with a UITextView on my View, designed in
I have a project that was developed for iPhone OS 2.0. I am transforming
I have an iPhone project in xcode that needs to be compiled for armv7
I have an existing iPhone project that has been tested, submitted, and approved, compiled
I have to make an iPhone project that can process video data in realtime.
I have created a iPhone project with option Create local git repository for this
I have an iPhone project that uses GHUnit to conduct unit testing. Recently, I've
I have an iPhone project that displays some data of the past 24h in
In my current iPhone project, I have a created a dictionary that groups the
So I have two view controllers in my iphone project - one of them

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.