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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:32:58+00:00 2026-05-11T15:32:58+00:00

I am developing an iPhone app for some sweet undergrad research I’ve been working

  • 0

I am developing an iPhone app for some sweet undergrad research I’ve been working on. Sadly, my school doesn’t offer software engineering / design classes so when it comes to questions of best practices in OO Design, I do a lot of reading.

My Dilemma:

My application loads a view (v1) where, upon user’s button click, v1’s controller class executes an action method. This action method should fill an array with objects. After that, the user will either execute the action again or click a different tab to load another view. Other views in the application will use the array that v1 populated.

So, where should this shared array be declared? Right now, it’s in the AppDelegate class from when I was testing features without a GUI. Should I grab the AppDelegate singleton and add items to it in the v1ViewController? Should it be declared as static?

Thanks for the help!

^Buffalo

EDIT:

Follow-up Question: When interacting with a singleton, which is the better way to talk to it:

[[MyAwesomeSingleton sharedInstance] gimmeSomePizza];  

or

MySingleton *s = [MySingleton sharedInstance];  [s gimmeSomePizza];  

I guess what I’m wondering is, do you make the sharedInstance method call every time or do you define a pointer to the sharedInstance and then reference the pointer?

  • 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. 2026-05-11T15:32:58+00:00Added an answer on May 11, 2026 at 3:32 pm

    Using the app delegate to store data that’s shared between views and view controllers is reasonable and appropriate.

    In my apps, I view the app delegate as the controller part of MVC, with UIViews and view controllers all being part of the ‘view’. I prefer to use a variant of MVC called Passive View that keeps the model and view parts of my app strictly segregated with only the controller connecting them.

    I’m assuming that the array of objects you’re storing is your app’s model, so storing them on your app delegate makes sense. As Daniel D said, there’s no need to make it static.

    The app delegate is really the heart of your program. You create and initialize your model and views in your -applicationDidFinishLaunching: method and save your model data and view state in -applicationWillTerminate:. When your view controllers receive events that changes your model, you can call methods on your app delegate to make those changes.

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

Sidebar

Ask A Question

Stats

  • Questions 190k
  • Answers 190k
  • 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 normalize-space is a function. You can't use it there. You… May 12, 2026 at 5:56 pm
  • Editorial Team
    Editorial Team added an answer Ok So I've managed to answer my own question, although… May 12, 2026 at 5:56 pm
  • Editorial Team
    Editorial Team added an answer .htaccess Basic Authentication is just that - only authentication. There… May 12, 2026 at 5:56 pm

Related Questions

I am developing an iPhone app for some sweet undergrad research I've been working
I've got an iPhone app I'm developing and when the app launches I open
I am new to developing on the iPhone so am sorry if this is
I am thinking about buying an iPod touch to make some money on developing
I'm developing for iphone-sdk 2.2.1 (so no CoreData cry ). So I'm using the

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.