• 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: NSOutlineView and arrangedObjects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSOutlineView and arrangedObjects


  • Subject: Re: NSOutlineView and arrangedObjects
  • From: William Turner <email@hidden>
  • Date: Fri, 25 Jan 2008 08:09:43 -0800

You can treat that as the "root" of the tree, an NSTreeNode object. On it, you can call -childNodes to get an array (of children!).

NSTreeController changed somewhat in Leopard. From the class reference:

Returns an proxy root tree node for the containing the receiver’s sorted content objects.

Prior to Mac OS X v10.5 this method returned an opaque root node representing all the currently displayed objects. This method should be used for binding, no assumption should be made about what methods this object supports.

Wil

On Jan 25, 2008, at 2:25 AM, Ivan C Myrvold wrote:

In my application I have replaced an NSTableView with an NSOutlineView.
I used to have a routine like this


NSArray *arr = [otextArrayController arrangedObjects];
for (i=0; i<[arr count]; i++) {
MyTextElement *te = [arr objectAtIndex:i];

but when I changed the first line to

NSArray *arr = [otextTreeController arrangedObjects];

this no longer works, as arr is no an NSArray any longer, but an _NSControllerTreeProxy.

Looks like this is a private object, as I can find very little information about this class.

The _NSControllerTreeProxy object (arr) responds to the count method, giving me a correct count, but how can I iterate through the objects?

Ivan
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
This email sent to email@hidden


References: 
 >NSOutlineView and arrangedObjects (From: Ivan C Myrvold <email@hidden>)

  • Prev by Date: Re: Regular expressions in Cocoa?
  • Next by Date: Re: NSOutlineView and arrangedObjects
  • Previous by thread: NSOutlineView and arrangedObjects
  • Next by thread: Re: NSOutlineView and arrangedObjects
  • Index(es):
    • Date
    • Thread