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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:08:53+00:00 2026-06-08T12:08:53+00:00

I have my main app delegate I have a few UIViewController derived instances driven

  • 0

I have my main app delegate
I have a few UIViewController derived instances driven by a Storyboard

Say I’d like to provide a centralized persistence layer for my application – perhaps Core Data of SQLite. Where would I put those objects? I’m missing some centrally accessible “Application” class you can access from all the UIViewController instances.

Is there a pattern to follow 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-08T12:08:54+00:00Added an answer on June 8, 2026 at 12:08 pm

    What you’re describing is your model layer. There are two main ways to manage the model:

    • At application startup, create the main model object and hand it to the first view controller.
    • Make the main model object a Singleton.

    The “main model object” in both cases is generally some kind of object manager. It could be a document, or it could be a PersonManager if you have a bunch of Person objects. This object will vend model objects from your persistence store (generally Core Data).

    The advantage of a Singleton here is that it’s a little easier to implement and you don’t have to pass around the manager. The advantage of a non-Singleton is that it’s easier to have more than one (for a document-based system), and it’s easier to test and reason about non-singletons than singletons. That said, probably 80% of my projects use a singleton model manager.

    As a side note, that you appear to already understand: never store the model in the application delegate, and never use the application delegate as a “rendezvous point” to get to the model. That is, never have a sharedModel method on the application delegate. If you find yourself calling [[UIApplication sharedApplication] delegate] anywhere in your code, you’re almost always doing something wrong. Hanging data on the application delegate makes code reuse extremely difficult.

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

Sidebar

Related Questions

I have a main navigationController controlled on the app's delegate and this navigationController contains
I have set my app's initial view with storyboard to the main one. I
I have a main app and a plugin. The main app is exporting an
I have a main app that will have many plugins. Here is the PluginReader
I have a main C++ app built in Visual Studio 2005, called A.exe. It
We have App A as main app. Now we build from it App B
I have a widget that is a part of my main app. Usually when
I have a widget that supposed to call an Activity of the main app
If I have a whole bunch of requires in my main app file: require
I have a main branch with a file called app.js . I made changes

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.