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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:40:15+00:00 2026-05-27T08:40:15+00:00

I need some help in picking the ‘right’ solution for the following ‘problem’. I

  • 0

I need some help in picking the ‘right’ solution for the following ‘problem’.

I use the new storyboard feature to link all the screens of my application together. Basically the structure drills down to:

[Navigation Controller] => [View Controller #1] => [Tabbar Controller] => [View Controller #2]*

**(and some other tabs which are for now not important)*

I have attached a segue (push) from the first View Controller (#1) to the View Controller behind the Tab Bar Controller. This push is triggered when the users presses something on the first controller and works fine.

// Execute preset segue
[self performSegueWithIdentifier:@"segueEventDetail" sender:self];

When the user (which is now in the View Controller #2) presses the back button in the navbar the user goes back. Suppose he now triggers the segue again, the second view controller is shown again but is now ‘resetted’ (empty). (I believe after reading several fora and articles this is standard behavior when using segue’s because these destroy and reinitiliaze the view controller’s every time?)

This (the view controller being resetted) poses a problem because the contents of the second view controller is dynamic (depend on a JSON response from the server) and thus it is ‘needed’ that the view controller remains intact (or is restored) when the user comes back.

I have found several sources (see bottom) describing the same issue, but the solutions vary and I need some help picking the right one.

Summarize:

  • How can I ‘retain’/save the state of a View Controller when the users presses back, while preserving the use of Storyboard & preferably also Segue’s

Own Thoughts:

#1 I’m now thinking of caching the JSON Response to my singleton class (and from there to a PLIST) and checking within the second view controller if this data is present and than rebuild the view after which I check for any new data (resume normal operation).

#2 Another one I’m thinking of is ‘bypassing’ the segue and manually handle the switch of views , partially explained in (Storyboard – refer to ViewController in AppDelegate) – Is this also possible?

But maybe there is an easier/better option?

http://www.iphonedevsdk.com/forum/iphone-sdk-development/93913-retaining-data-when-using-storyboards.html
Storyboard – refer to ViewController in AppDelegate
How to serialize a UIView?

  • 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-27T08:40:16+00:00Added an answer on May 27, 2026 at 8:40 am

    For anyone coming across this (my) question in the future, this is how I ended up ‘coding’ it.

    • Open the storyboard and select your ‘Tab Bar Controller’ and open the Attributes Inspector

    • Fill in an ‘identifier’ in the field

    • With the first view controller (see scenario in original post) I create an global reference to the viewcontroller:

    firstviewcontroller.h

    @interface YourViewController : UIViewController {
    
        UITabBarController *tabController;
    
    }
    

    firstviewcontroller.m

    //Fill the reference to the tabcontroller using the identifier
    tabController = [self.storyboard instantiateViewControllerWithIdentifier:@"tabbar"];
    

    Now to switch from the firstviewcontroller the following line can be used:

    [[self navigationController] pushViewController:tabController animated:YES];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need some help with this problem in implementing with XSLT, I had already implemented
I need some help regarding algorithm for randomness. So Problem is. There are 50
Need some help understanding if I'm on the right track here and exactly what
Need some help with extracting 2 pieces of information from the following string: viewed
Need some help with a small problem. I'm not too hot on the maths
I need some help finding information (or an example) of how to use texture
Need some help about with Memcache. I have created a class and want to
Need some help, please. I have a line of horizontal thumbnails loaded as ONE
Need some help to solve this. I have a gridview and inside the gridview
Need some help gathering thoughts on this issue. Our team is moving ahead with

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.