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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:28:00+00:00 2026-06-04T10:28:00+00:00

I have some data strings that from one screen of my app that I

  • 0

I have some data strings that from one screen of my app that I would like to store (in a model) and then retrieve if the user navigates back to the same page. Right now the data is getting stored fine in a model, however, I’m running across a problem because it seems like each time you return to a screen you generate a new instance of the controller. Thus, my model is not of any good because I lose a reference to it (it’s currently stored as an instance variable inside my controller). What am I doing wrong?

  • 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-04T10:28:03+00:00Added an answer on June 4, 2026 at 10:28 am

    What am I doing wrong?

    You’ll typically have a model (which might be a collection of objects, not necessarily just one) that’s shared across your document or application. When a view controller is created, it’s given a reference to the model (or to some part of the model). If it in turn creates another view controller, it passes on a reference to the model to that object. The model is thus shared by all the view controllers. The model isn’t forgotten when a view controller is deallocated because the other controllers know about it.

    It sounds like you’ve got the beginning of a model, but it’s limited to a single view controller. Maybe you’ve got the same situation with some of your other view controllers, too. Think about how you can tie all those small models together into a larger object graph. That’ll make it easier to remember, and it also allows you to put the responsibility for saving the entire model in a single object like your app delegate or root view controller.

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

Sidebar

Related Questions

I Have activity that get some data from the internet, and shows it to
I have some existing code that retrieves data from a database using ADO.NET that
I'm actually having some strings that have some data separated by a pipe character,
i have some data to write in data base (three strings); i have a
I have some data structures: all_unordered_m is a big vector containing all the strings
I received some multi-line data via HTTP and have it in one string. I
I have some data structures that stay unchanged if you try to add something
I'm working with some binary data that I have stored in arbitrarily long arrays
I have been given a task of inputting some student data, like option 1:
I have an external module, that is returning me some strings. I am not

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.