Drag from Table To View
Drag from Table To View
- Subject: Drag from Table To View
- From: email@hidden
- Date: Sat, 25 Sep 2010 14:43:02 -0600
Earlier this I got help on dragging from NSView to NSView .. got it
working just fine.
Made some changes and want to drag from a Table to the same view I had
accepting drops previously.
I do this in my table sub class awakeFromNib
[self registerForDraggedTypes:[NSArray arrayWithObject:@"Obstacles"]];
and I implement
- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:
(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard {
NSLog(@"writeRowsWithIndexes %@", rowIndexes);
NSData *zNSIndexSetData = [NSKeyedArchiver
archivedDataWithRootObject:rowIndexes];
[pboard declareTypes:[NSArray arrayWithObject:@"Obstacles"]
owner:self];
[pboard setData:zNSIndexSetData forType:@"Obstacles"];
return YES;
}
which as I understand the docs is all that is required to have a table
as a drag source.
But, It don't work so what now brown cow?
Thanks -koko
_______________________________________________
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