Re: Rearranging NSOutlineView via drag-and-drop
Re: Rearranging NSOutlineView via drag-and-drop
- Subject: Re: Rearranging NSOutlineView via drag-and-drop
- From: Akis Kesoglou <email@hidden>
- Date: Mon, 05 Jan 2015 15:24:32 +0200
> But in my app, whether an item has children or not can affect which icon appears beside it in the list. Unfortunately, reloadItem: doesn't request a view, which would call the function that assigns icons, nor can I figure out how to ask the outline for the view after my delegate creates it. Rather than trying to come up with some system to track the views outside of the outine, I gave up and simply use performSelector:withObject:afterDelay using a 0.5-second delay to call a method which reloads the entire outline after a move operation is successful. Now rearranging the tree works as expected and both the disclosure triangles and the item icons get updated properly.
Bindings can help you there — you could bind the image view and text label to the row’s objectValue and you could assign another icon on item move and the view would update itself. This won’t help you with the disclosure triangle, but maybe it’s worth exploring.
_______________________________________________
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