setContent: vs bind:toObject:withKeyPath:options: ?
setContent: vs bind:toObject:withKeyPath:options: ?
- Subject: setContent: vs bind:toObject:withKeyPath:options: ?
- From: Keith Blount <email@hidden>
- Date: Wed, 28 Dec 2005 07:46:27 -0800 (PST)
Hello,
I have an NSTreeController and I want to bind its
content array programmatically, in order to avoid the
well-known retain loop caused by binding content in IB
(whereby the document never gets released properly).
I have several NSArrayControllers, and to bind their
contents programmatically, all I have to do is call
-setContent:. However, this does not seem to work with
NSTreeController. After trying various different
approaches, I finally realised that the only way to
bind the content of an NSTreeController
programmatically was by calling [treeController
bind:@"contentArray" toObject:self
withKeyPath"rootNodes" options:nil].
Does anybody know why this is? It seems strange that I
have to use different approaches for NSArrayController
and NSTreeController. Is this just another of
NSTreeController's many quirks (others of which
include having to use undocumented private methods
just to implement D'n'D, broken state-saving, etc
etc)?
Thanks,
Keith
__________________________________________
Yahoo! DSL Something to write home about.
Just $16.99/mo. or less.
dsl.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden