I may have gone about things wrong, but I added drag-and-drop rearrangement to 
a source view by implementing these NSOutlineViewDataSource methods:

outlineView:writeItems:toPasteboard:
outlineView:validateDrop:proposedItem:proposedChildIndex:
outlineView:acceptDrop:item:childIndex:



If all sanity checks pass, the latter function makes changes to my model and 
returns YES.

These things work, and I can verify that the object graph in the model has 
changed correctly. But to see the changes reflected in my Source View, I have 
to collapse and re-expand the affected nodes in order to have them reload data 
from the model in its new state. (I’m kind of surprised that updating the 
outline isn’t automatically done as a result of successfully accepting an 
NSDragOperationMove.)

Is it a good idea to call reload functions from 
outlineView:acceptDrop:item:childIndex:, or should I be doing something else to 
update the outline?

—

Charles Jenkins

_______________________________________________

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

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

Reply via email to