How do you redesign the view, for example in a table view?
You have to implement drag'n drag material .
These are the methods you must implement in your NSOutlineView data source.
- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(int)index;
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(int)index;
Read more about NSOutlineViewDataSource Protocol Reference .
You also need to register the drag types for your outlineView
[outlineView registerForDraggedTypes: [NSArray arrayWithObjects: NSStringPboardType, NSURLPboardType, NSFilenamesPboardType,NSFileContentsPboardType, nil]];
a source to share
If you're having trouble finding Apple docs, try reading Jonathan 's reorder message .
Ok, if it's a bit, try the AbstractTree sample code from the Apple ADC site. The drag and drop methods are highlighted in the AppDelegate.
I don't mean to sound rude, but are you working through the tutorial or see the links? I am asking because simply asking for code that you can insert will not be helpful to you: there is no generic code that you can just walk in. You need to write for your specific case. Without knowing this, we cannot just write your methods for you.
Try using the drag and drop methods of the example from AbstractTree, and if you still have problems, try posting the code you wrote that doesn't work.
a source to share