• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Rearranging NSOutlineView via drag-and-drop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Rearranging NSOutlineView via drag-and-drop


  • Subject: Rearranging NSOutlineView via drag-and-drop
  • From: Charles Jenkins <email@hidden>
  • Date: Sat, 03 Jan 2015 15:13:26 -0500

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 (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


  • Follow-Ups:
    • Re: Rearranging NSOutlineView via drag-and-drop
      • From: Quincey Morris <email@hidden>
  • Prev by Date: Re: Bifurcating text color in QL on X.6, how? (Quincey Morris / Jens Alfke)
  • Next by Date: Re: Rearranging NSOutlineView via drag-and-drop
  • Previous by thread: Re: Bifurcating text color in QL on X.6, how? (Quincey Morris / Jens Alfke)
  • Next by thread: Re: Rearranging NSOutlineView via drag-and-drop
  • Index(es):
    • Date
    • Thread