Re: NSOutlineView Not Updating After Adding Items
Re: NSOutlineView Not Updating After Adding Items
- Subject: Re: NSOutlineView Not Updating After Adding Items
- From: Quincey Morris <email@hidden>
- Date: Thu, 6 Aug 2009 13:02:43 -0700
On Aug 6, 2009, at 12:19, Mark Szymczyk wrote:
I was calling the NSXML add methods. Thanks for pointing that out.
Well, I gave you the wrong answer. That may have been the correct way
after all.
I tried creating the NSXML objects I want to add and adding them to
the tree controller using the add:, addChild:, insert:, and
insertChild: methods, and I get the same results. The methods
canAdd:, canAddChild:, canInsert:, and canInsertChild: all return NO.
That was also the wrong answer. These methods don't add an object you
create. For that, you need to use
'insertObject:atArrangedObjectIndexPath:'.
But NSXMLElement does claim KVO compliance for 'children', so your
original approach should have been fine. And, if not, invoking
'rearrangeObjects' should have taken care of it.
The next step is probably to examine the NSTreeNode structure of the
NSTreeController's arrangedObjects after you add an element, and
decide whether the NSTreeController is missing the change, or if the
NSOutlineView is missing the change.
_______________________________________________
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