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

  • Home
  • SEARCH
  • 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 7523037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:40:50+00:00 2026-05-30T02:40:50+00:00

I need to set some UI elements of an UIViewController from AppDelegate. I use

  • 0

I need to set some UI elements of an UIViewController from AppDelegate. I use a Storyboard, so the UIViewController don’t become initialized in AppDelegate.

I try to get the instance of UIViewController with:

UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:[NSBundle mainBundle]];
TableViewController* myTableViewController = [storyboard instantiateViewControllerWithIdentifier:@"myTableViewController"]; 

But when I try to set some UI element like the UIBarButtonItem of the UINavigationBar, like here:

UIBarButtonItem* refreshButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self action:@selector(refreshEntry)];
    myTableViewController.navigationItem.rightBarButtonItem = refreshButton;

the UINavigationBar stay blank and the UIBarButtonItem don’t appear…

How can I change the UI?

  • 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-30T02:40:52+00:00Added an answer on May 30, 2026 at 2:40 am

    Unfortunately, as far as I can tell, there is no way with Storyboards to plug in to the app delegate. Therefore, you can’t directly grab a handle to the view controller in your app delegate lifecycle methods to do some additional work.

    However, you DO know that the app delegate’s windows’ rootViewController property will be the initial view controller you specify in your Storyboard. So you can always do something like this:

    XXRootViewController *rootViewController = (XXRootViewController *)self.window.rootViewController;
    [rootViewController doAdditionalWork];
    

    Also, the reason why calling -instantiateViewControllerWithIdentifier: on your Storyboard didn’t work is, well, because it’s actually instantiating a new view controller. However, the view controller hierarchy you set up in your Storyboard file is what is actually unarchived when your app launches. So you’re effectively instantiating that view controller, making some changes to it, and then it’s being deallocated.

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

Sidebar

Related Questions

I need to do some REST service testing from Firefox where I set the
I need to wrap a List<T> with some class that allows calls to set/get
I need to set some server specific variables in a rails application that will
I need to set up some RewriteRules to redirect a URL which has a
I need to set up some SET options in Oracle SQLplus command line program
I need to set the height of every textbox on my form, some of
here is some code I've been working on, basically I need to set up
I have a page with some HTML in it. and I need to set
I need to ship some Java code that has an associated set of data.
I display set of images(small). I need to show the larger image(300*300) at some

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.