• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Application Design
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Application Design


  • Subject: Application Design
  • From: Dan Hopwood <email@hidden>
  • Date: Fri, 27 May 2011 19:13:17 +0100

Hi all,

I have been writing iPhone applications for a while now, with not too many
problems but I feel like I haven't fully grasped how an application should
be structured in terms of storing application objects. e.g. up to now, I've
created a header file, declared all the main objects e.g. app delegate, view
controllers, utilities and initialised them in the app delegate. For each
class, I then just include the header file, which gives me access to all the
objects, should I need to send them messages on certain UI events.

Another option I have considered is storing them all in the app delegate
instead and creating utility methods in the app delegate that delegate out
to the objects from one place. E.g. a VC would then call the app delegate
each time it needs to interact with another VC.

If neither of these options is valid, which I suspect is the case (certainly
global pointers is considered to be bad practise), then how do you store
these pointers to that they are accessible in some way by all the VCs.
Sending in the required pointers on initialisation of each VC (and storing a
copy in each class) is the only other option I can think of but this seems
annoyingly unelegant.

Thoughts and suggestions much appreciated.

Dan
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Application Design
      • From: Steve Christensen <email@hidden>
  • Prev by Date: Re: TransformProcessType() still doesn't show menu (Bug ID# 5905139)
  • Next by Date: Re: Application Design
  • Previous by thread: Re: How to see a video from YouTube on Iphone
  • Next by thread: Re: Application Design
  • Index(es):
    • Date
    • Thread