• 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
setContent: vs bind:toObject:withKeyPath:options: ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: setContent: vs bind:toObject:withKeyPath:options: ?
      • From: Camillo Lugaresi <email@hidden>
  • Prev by Date: Re: Best place to set custom NSButtonCell?
  • Next by Date: Re: Agent Applications and launchd
  • Previous by thread: Cocoa Birds of a Feather
  • Next by thread: Re: setContent: vs bind:toObject:withKeyPath:options: ?
  • Index(es):
    • Date
    • Thread