• 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: [Q] How to add nested items to NSOutlineView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] How to add nested items to NSOutlineView?


  • Subject: Re: [Q] How to add nested items to NSOutlineView?
  • From: JongAm Park <email@hidden>
  • Date: Thu, 06 Nov 2008 09:39:48 -0800

Thank you Mr. Stiglitz.

It worked!!! :)
My original code accessed interested items in a data source using objectForKey:. I think it is also KVO compliant call. And the data items in the data source were all mutable types. So, the objectForKey also returned a mutable array, but it didn't work.


So, we should use their special methods prepared for the binding purpose!
It would be much nicer if they put the examples in their NSTreeController, NSOutlineView document!


Special Thanks!
JongAm Park


Benjamin Stiglitz wrote:
However, if I get reference of an item in existing view and insert new item in its data source, NSMutableArray, it can't display the newly added nested items.

I tried NSTreeController's rearragneObjects and the NSOutlineView's reloadItem:reloadChildren, but it doesn't seem to work for me.

Can anyone tell me how to add new items?

Since you’re using NSTreeController, you should modify the array in a KVO-compatible way. Take a look at
<http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Protocols/NSKeyValueCoding_Protocol/Reference/Reference.html#//apple_ref/occ/instm/NSObject/mutableArrayValueForKeyPath:>



-Ben

_______________________________________________

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: 
 >[Q] How to add nested items to NSOutlineView? (From: JongAm Park <email@hidden>)
 >Re: [Q] How to add nested items to NSOutlineView? (From: Benjamin Stiglitz <email@hidden>)

  • Prev by Date: How to convert NSString to wstrings?
  • Next by Date: Re: Authorization and removing folders
  • Previous by thread: Re: [Q] How to add nested items to NSOutlineView?
  • Next by thread: Enumerating outlets automatically?
  • Index(es):
    • Date
    • Thread