Search code examples
cocoadrag-and-dropnsoutlineview

What to use in lieu of NSOutlineViewDataSource outlineView:draggingSession:endedAtPoint:operation:?


Unlike NSTableViewDataSource, the NSOutlineViewDataSource protocol has no outlineView:draggingSession:endedAtPoint:operation: selector. When a user drags an item from my NSOutlineView, how do I detect when the item has been dropped?

I tried implementing draggingSession:endedAtPoint:operation: in my datasource/delegate, but it never gets called.


Solution

  • NSOutlineViewDataSource does define the outlineView:draggingSession:endedAtPoint:operation: method, you can see it if you look at the header. I have no idea why it's not in the docs.

    To see the header, choose File > Open Quickly in Xcode and type NSOutlineView.

    The method is only available as of 10.7.