Newbie: Drag of Custom Type from NSOutlineView
Newbie: Drag of Custom Type from NSOutlineView
- Subject: Newbie: Drag of Custom Type from NSOutlineView
- From: Jerry Krinock <email@hidden>
- Date: Sat, 19 Nov 2005 16:32:35 -0800
- Thread-topic: Newbie: Drag of Custom Type from NSOutlineView
- (BOOL)outlineView:(NSOutlineView*)olv
writeItems:(NSArray*)items
toPasteboard:(NSPasteboard*)pboard
{
NSArray* myTypeOnly = [NSArray arrayWithObject:MyPboardType];
[pboard declareTypes:myTypeOnly owner:self];
NSLog(@"Writing items to %@ pasteboard:\n%@", pboard, items) ;
BOOL success = [pboard setPropertyList:writeItems
forType:MyPboardType] ;
NSLog(@"success writing to pasteboard = %i", success) ;
NSLog(@"pboard payload looks like:\n%@",
[pboard propertyListForType:MyPboardType]) ;
return success ;
}
The first NSLog logs an array containing the dragged items, as expected.
The second NSLog logs that success = 1, as expected.
The third NSLog simulates what my drop destination does to unload the
pasteboard. I expect to get my array of items, but I get (null). The same
thing happens in the actual drop method.
How can something so simple not work?
Jerry Krinock
By the way, my "drop" code works fine, and I have previously implemented
drag and drop from within this same table, using a "sneaker pasteboard",
which is an NSArray object instance variable, and that works fine. But now,
so I can drag and drop between diffferent outlines, I want to do it the
"right" way, to actually put the data on the pasteboard.
_______________________________________________
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