help dragging from NSTableView to NSOutlineView, Core Data
help dragging from NSTableView to NSOutlineView, Core Data
- Subject: help dragging from NSTableView to NSOutlineView, Core Data
- From: Dan Donaldson <email@hidden>
- Date: Tue, 12 Sep 2006 20:28:07 -0400
I'm having difficulties obtaining the object(s) dragged from an
NSTableView to an NSOutlineView when the drop happens.
Both views are in the same window. Both are controlled by separate
Array and Tree Controllers. Drag and Drop inside the NSOutlineView is
working fine. I see the drag initiating, and the acceptDrop is
happening on the outlineview side. Just about all the right messages
are getting passed, but when the drop happens on the Outline, the
only thing that I can see I have access to in
- (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id
<NSDraggingInfo>)info item:(id)item childIndex:(int)index
is [info draggingSource]. This is the NSTable that is the source for
the drag, but how do I ensure that the particular object being
dragged is available?
I've implemented three methods for the table view in the datasource -
both views use the same class as datasource:
- (BOOL)tableView:(NSTableView *)aTableView
writeRowsWithIndexes:(NSIndexSet *)rowIndexes
toPasteboard:(NSPasteboard*)pboard
and
- (NSDragOperation)tableView:(NSTableView*)tv validateDrop:(id
<NSDraggingInfo>)info proposedRow:(int)row proposedDropOperation:
(NSTableViewDropOperation)op
and
- (BOOL)tableView:(NSTableView *)aTableView
acceptDrop:(id <NSDraggingInfo>)info
row:(int)row
dropOperation:(NSTableViewDropOperation)operation
and all of them are firing. The rowIndexes are archived and given to
the pboard per an Apple example in
tableView:writeRowsWithIndexes:toPasteboard: .
Sorry if this is obvious, but I haven't gotten there yet...
dan
Dan Donaldson
416 604 3398
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden