Michael Hanna wrote:
My question is, how do I make a keypath from the tree controller to
the treeModel, since it's sitting inside a singleton? Would
programmatically setting the binding accomplish this?

If you have a NSApp subclass, an easy way to accomplish this is to add an accessor method there, i.e.:

- (id)dataModelMgr
{
        return [MyDataModelManager getInstance];
}

Then bind your tree controller to the "Shared Application" object with keypath @"dataModelMgr.treeDataModel" (or simplify this and have your accessor directly return the tree data model).

Also, would it be necessary for  MyTreeDataModel be an
NSArrayController subclass?

Why should it? As long as it complies with the NSTreeController requirements (see the documentation) you should be fine.

Note, though, that NSTreeController can be a pain to work with. Especially if you plan on supporting 10.4. But that's just my opinion...

--
Florent Pillet                        http://www.florentpillet.com
Software consultant - Mobile devices, desktop and server platforms
Mac OS X, iPhone, WinMob, Palm OS    Skype callto://florent.pillet
_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to