• 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
How best to access application-scope objects from documents
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How best to access application-scope objects from documents


  • Subject: How best to access application-scope objects from documents
  • From: Paul Thomas <email@hidden>
  • Date: Thu, 22 Mar 2007 09:48:07 +0000

Hi,

this is really a question about best practise in Document Architecture designs which are NIB based.

I'm adding a preferences controller to my application to manage all of the NSUserDefaults and also control a preferences window. This is all going swimmingly but, being a little new to the whole NIB-based thing, I'm not sure how the document objects should be accessing this controller.

The controller is instantiated by the MainMenu NIB - but it isn't hooked up to anything except the menu. So far as I can see, I can either look through the top level objects or add an outlet to the application delegate (prefer the later). But then I have to get the reference to the documents. Do I need to subclass the document controller to pass it to the initialiser, or is it better to 'reach back' and traverse the object graph from doc through app to the delegate. They both seem a bit messy unless I've missed something.

cheers,
paul.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: How best to access application-scope objects from documents
      • From: "I. Savant" <email@hidden>
  • Prev by Date: Re: imageNamed cannot load an image
  • Next by Date: Re: imageNamed cannot load an image
  • Previous by thread: Re: Retained ivars being set to 0x0 (SOLVED)
  • Next by thread: Re: How best to access application-scope objects from documents
  • Index(es):
    • Date
    • Thread