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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:24:50+00:00 2026-06-08T04:24:50+00:00

I have run into some odd behavior of UIBarButtonItem/UINavigationBar when I attempt to restore

  • 0

I have run into some odd behavior of UIBarButtonItem/UINavigationBar when I attempt to restore the state of a UINavigationController between launches.

The below code snippet shows how I restore the state of a navigation controller. This code snippet is executed in the viewDidLoad method.

NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
if ([ud objectForKey:HBStateRestorationQuoteSelection]) {
    NSInteger index = [ud integerForKey:HBStateRestorationQuoteSelection];

    // Fetch Quote
    NSDictionary *quote = [self.quotes objectAtIndex:index];

    // Initialize Quote View Controller
    HBQuoteViewController *vc = [[HBQuoteViewController alloc] initWithNibName:@"HBQuoteViewController" bundle:[NSBundle mainBundle]];
    vc.quote = quote;

    // Push Quote View Controller Onto Navigation Stack
    [self.navigationController pushViewController:vc animated:NO];
}

The result is that the back button title is truncated for some reason. This behavior is not present when the navigation controller is used in a normal fashion.

Note that the truncation is not due to the size of the title in the navigation bar. As I mentioned before, the title of the back bar button is displayed normal when I don’t use this state restoration logic.

I also tried putting the restoration code in the viewWillAppear method or changing the title of the back bar button by creating a custom back bar button, but none of these approaches solve the problem.

enter image description here

  • 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-08T04:24:53+00:00Added an answer on June 8, 2026 at 4:24 am

    I suspect the problem is due to pushing the controller before the parent has a view showing. I believe you may have some success with the following although its a bit of work.

    • when you are going to restore state, then hide the navigation bar in the root view controller, and present the launch image instead of your normal content.

    • when the root view controller gets “viewDidAppear”, then use a dispatch block on the main queue, and push other controllers, also configured to hide the navigation bar and showing the launch image.

    • when you get to the view controller that is SUPPOSE to be shown, at that point show the real view and enable showing the Navigation bar.

    This is a compressed way of doing more or less what the system is doing, always having the parent view at least get to “viewDidAppear” before pushing another view.

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

Sidebar

Related Questions

I have run into some trouble with the gd library's imagefilledpolygon() . For some
I am creating a small Yahtzee game and i have run into some regex
I am trying to build a responsive email template but have run into some
I am using notepad++ to do some date conversions but have run into a
I am using Solaris. I have to log into sql plus and run some
I am using djangoappengine and I think have run into some problems with the
Good day, I have run into some problem in the Zend_Cache_Frontend_Page. I want to
I've made test Program for some Sharepoint WSS3 features but I have run into
I'm trying to build my first generic list and have run into some problems.
I'm writing code for a blackjack game and have run into some problems. I

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.