NSOutlineView Not Updating After Adding Items
NSOutlineView Not Updating After Adding Items
- Subject: NSOutlineView Not Updating After Adding Items
- From: Mark Szymczyk <email@hidden>
- Date: Wed, 5 Aug 2009 16:33:24 -0400
I'm using NSOutlineView and NSTreeController to display and edit an
NSXMLDocument on Mac OS X 10.5. The application uses bindings and is
based on the "Using Tree Controllers with NSXML Objects" example in
the Tree-Based XML Programming Guide. I get some strange behavior when
I add elements to the XML document.
If the parent has not been expanded in the outline view when I add a
new element to it, the outline view behaves properly. When I expand
the parent in the outline view I can see the new element has been
added. Once I expand the parent, a problem arises. Any new elements I
add to that parent do not appear in the outline view. Collapsing the
parent in the outline view and resizing the window do not help. The
elements get added to the XML tree. They're just not getting added to
the outline view. I know the elements are being added to the XML tree
because saving the document, closing it, and reopening it makes the
added elements appear in the outline view.
I have tried calling the outline view's reloadData method and the tree
controller's rearrangeObjects method. I have also tried calling the
outline view's reloadItem:reloadChildren method, but the outline view
still not does not update after expanding a parent element in the
outline view. What do I have to do to get the outline view to display
the proper information?
Mark
_______________________________________________
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