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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to