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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:32:17+00:00 2026-05-20T18:32:17+00:00

I am currently writing a multi-user social iPhone app which interfaces with a server.

  • 0

I am currently writing a multi-user social iPhone app which interfaces with a server.

I have a User class, which stores all the general data about each user (name, id, etc etc). However, where I am tripping up is how best to store these users.

Currently, I have a Singleton called “UserManager”, which stores an array of each user in the application (downloaded from the server – on initial launch you are prompted to input some basic details), as well as a separate user object to differentiate the actual current user of the app. The user list needs to be accessed from many different parts of the app, including a map which shows where they are (if they choose to reveal it), to a list of other users to enable sending messages to them, etc.

To be completely honest, the Singleton solution doesn’t sit right with me. I have always heard to avoid Singletons wherever possible, however I’m drawing blanks on what is better to use.

I only have a fairly basic understanding of Design Patterns, though obviously I know that shoehorning a pattern when its not required is a horrible idea.

So I returned here to ask you good people in what manner you would store this kind of data! I don’t necessarily mean iPhone only either, this is a wider problem. I fail to understand properly how I should do this kind of thing in any situation.

Thanks in advance!

  • 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-20T18:32:18+00:00Added an answer on May 20, 2026 at 6:32 pm

    You’re on the right track in that you want some sort of data controller object which will handle your user data objects from you. You could make this object a singleton, or you could not. The alternative is to have your application controller (app delegate usually) instantiate the data controller, and pass it on to each of your window or view controllers at launch time. One advantage is that it would be easier to modify your application to have multiple data controllers; this isn’t as important for an iPhone app, but it may be an issue for a desktop app that could have multiple document windows open at once. On the other hand, a singleton is probably going to be simpler to code and may prevent bugs down the road.

    You might find the last few paragraphs on the Apple MVC design pattern documentation interesting, it talks a little bit about separating the model controller / view controller roles.

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

Sidebar

Related Questions

I am currently writing a simple, timer-based mini app in C# that performs an
I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP
I'm currently writing a TYPO3 extension which is configured with a list of tt_content
Im currently writing my bachelor thesis with latex and using TexnicCenter. I want to
Our company is currently writing a GUI automation testing tool for compact framework applications.
I am currently writing a small calendar in ASP.Net C#. Currently to produce the
I'm currently writing an interface to allow applications to send exception data to a
I'm currently writing a simple .sh script to parse an Exim log file for
Scenario: I'm currently writing a layer to abstract 3 similar webservices into one useable
I am currently writing a little bootstrap code for a service that can be

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.