On Sep 27, 2009, at 11:19 AM, jon wrote:

the question it appears to me is: that this "treeController" also is made into multiple instances with each new Document, is there an already defined "loop" of these? (a list of the open document's NSTreeController *treeController;)

No. I think you're confused about now nibs work. In your example, 'treeController' is an instance variable (or field) of your document class. That means every instance of the class has one.

What happen when creating a document is that the NSDocumentController creates a new instance of your document subclass, then loads a new copy of the nib with your document object as its 'owner'. This creates a new instance of every object contained in the nib; and the instance variables of the owner object (your document) get connected to those new objects as you specified. So in your new document object, the treeController instance variable will point to the new tree controller.

So every open document has one tree controller. If you want to find the list of open documents, ask the NSDocumentController.

—Jens_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to