• 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
Re: Document App: IB connections 101
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Document App: IB connections 101


  • Subject: Re: Document App: IB connections 101
  • From: jerome LAURENS <email@hidden>
  • Date: Wed, 24 Jul 2002 14:28:40 +0200

Le mardi 23 juillet 2002, ` 05:40 PM, Michael Willhide a icrit :

if this is a "global" tool manager, it is certainly a sharedInstance of
some class. So you can create an instance of it in your nib file and
make the appropriate connection. If you implement correctly the
initWithCoder: to return the shared instance, any object instantiated in
any nib will be in fact the shared instance, and your connections will
point to the right manager.

Interesting. The document framework uses a separate nib file for the document class. So you're saying to create an instance of the tool manager in the nib file for the document, as well as in the application nib file, make the appropriate connections in each of the files.. and then implement initWithCoder: such that it returns the same instance in both cases?


This works well, for any kind of nib. Also, you do not need to instantiate your global manager in the application nib if no action is connected to it there. This design makes the nib files more readable because there are less connections to the first responder. However there is a cost in loading the nibs due to the initWithCoder message being sent but this seems to be a quite null cost.

To implement the initWithCoder, just start from the standard pattern of shared instances.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
References: 
 >Re: Document App: IB connections 101 (From: Michael Willhide <email@hidden>)

  • Prev by Date: Re: cycle through windows
  • Next by Date: Re: Document App: IB connections 101
  • Previous by thread: Re: Document App: IB connections 101
  • Next by thread: Re: Document App: IB connections 101
  • Index(es):
    • Date
    • Thread