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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to