Can't drag a custom data object.
Can't drag a custom data object.
- Subject: Can't drag a custom data object.
- From: Billy Flatman <email@hidden>
- Date: Mon, 26 Apr 2010 13:58:04 +0100
Hi all,
I'm trying to put a custom object into past board in order to perform a drag operation. It's working fine if I drag a string, but if I try to pass an object, I can't get it to work.
- (BOOL)outlineView:(NSOutlineView*)outlineView writeItems:(NSArray*)items toPasteboard:(NSPasteboard*)pboard {
NSString* kOutlineViewGroupType = @"IFNode";
[pboard clearContents];
if([[items objectAtIndex:0] isParent]) {
return NO;
}
itemsBeingDragged = items;
[pboard declareTypes:[NSArray arrayWithObjects:NSStringPboardType, kOutlineViewGroupType, nil] owner:nil];
** This works.
[pboard setString:[[items objectAtIndex:0] title] forType:NSStringPboardType];
** This doesn't (actually stops drag and drop working for my application until I logout).
[pboard setData:[items objectAtIndex:0] forType:kOutlineViewGroupType];
return YES;
}
Any help greatly appreciated.
Cheers,
Billy Flatman
email@hidden
_______________________________________________
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