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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:35:57+00:00 2026-05-12T11:35:57+00:00

(By the way, I don’t use Interface Builder) I have a little project consisting

  • 0

(By the way, I don’t use Interface
Builder)

I have a little project consisting of a root UIViewController which manages 5 other View Controllers with a UITabBar, I’m not using UITabBarController. The Root View Controller only ever keeps one of its View Controllers instantiated, when a tab bar item is selected, the View Controller associated with that tab gets instantiated, the old one is removed, the new one is added as a subview and the old one is deallocated.

Each View controller has a UIPickerView (except one that has a UIDatePicker). When the user goes from tab 1 to tab 2 and the back to tab 1, I want the View Controller to be instantiated with the same selected row in the picker as it was before, even though it got deallocated, so I understand its best to use instances of a Model class to store information about a View Controller’s state and then make init methods in each View Controller that initialize with an argument given which is an instance of the Model.

So could someone help me out? What should the Model class look like? What should it be named? How can an instance of it be used to store information about the state of one View Controller and another instance store information about another, different View Controller? I really want to get this simple project as perfect as it can be and to follow the MVC design pattern, so I can base all my other tab bar applications off this.

Thanks!!

  • 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-12T11:35:57+00:00Added an answer on May 12, 2026 at 11:35 am

    OK well to anyone else wondering about this, I made a class, called it Model, and made it a singleton with Download SynthesizeSingleton.h.zip macro. You can use KVO (Key-Value Observing) to do stuff when stuff in the Model changes, learn about that Here, and you can e.g. have a UITextField delegate method for when the Text Field is edited and in that method set the ivar in the Model for your text field with the new text the user changed it to.

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

Sidebar

Ask A Question

Stats

  • Questions 339k
  • Answers 339k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer When you mix date and number, date is treated as… May 14, 2026 at 4:28 am
  • Editorial Team
    Editorial Team added an answer Most of the classes in Cocoa Touch list a "designated… May 14, 2026 at 4:28 am
  • Editorial Team
    Editorial Team added an answer There is a pack of charting controls from MS, which… May 14, 2026 at 4:28 am

Related Questions

(By the way, I don't use Interface Builder) I have a little project consisting
(We're talking about code inside custom UIViewController subclasses -- And by the way I
I'm getting stymied by the way dot notation works with objects and records when
I was thinking along the lines of using typeid() but I don't know how
How do I properly set the default character encoding used by the JVM (1.5.x)

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.