I'm trying to enable drag and drop functionality for NSOutlineView in my MacOS app. I want to drag a child from a folder to another folder within the outline view.
I want test asset 1 to be dragged and dropped in Group 2
I have myOutlineView and a controller which is a data source and a delegate of my outline view.
In my outline view controller I have these three methods:
-(BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pboard
-(NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id < NSDraggingInfo >)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
-(BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id < NSDraggingInfo >)info item:(id)item childIndex:(NSInteger)index
None of them is being called. My nib is setup properly, my outline view is getting filled and all of the functionality is working except the drag and drop feature.
I have also registered the drag type in awake from nib:
[_paraOutlineView registerForDraggedTypes:[NSArray arrayWithObject:@"QStyleSheetModel"]];
I also wrote this:
[_paraOutlineView setDraggingSourceOperationMask:NSDragOperationMove forLocal:YES];
What could be the reason?
setDraggingSourceOperationMask:forLocal:
?