Drag and Drop: Strange behavior with propertyListForType
Drag and Drop: Strange behavior with propertyListForType
- Subject: Drag and Drop: Strange behavior with propertyListForType
- From: Tristan Jehan <email@hidden>
- Date: Wed, 12 Apr 2006 20:19:08 -0400
I'm doing DND in an NSTableView subclass. My
tableView:acceptDrop:row:dropOperation: had no effect. But I
discovered the pasteboard wasn't set correctly in
tableView:writeRowsWithIndexes:toPasteboard:. I NSLogged some
information and found out something weird that I can't explain. I
have another very similar tableView where the same method behaves
properly. Under what conditions something like this could occur?
- (BOOL) tableView: (NSTableView *)tv
writeRowsWithIndexes: (NSIndexSet *)indexes
toPasteboard: (NSPasteboard *)pboard
{
NSArray *typesArray = [NSArray arrayWithObjects:
PVMovedRowsType, nil];
[pboard declareTypes:typesArray owner:self];
[pboard setPropertyList:indexes forType: PVMovedRowsType];
NSMutableArray *rowCopies = [NSMutableArray arrayWithArray: [[self
arrangedObjects] objectsAtIndexes: indexes]] ;
NSLog(@"%@", rowCopies);
[pboard setPropertyList:rowCopies forType: PVMovedRowsType]; // set
the pasteBoard property list with a type
NSLog(@"%d", [pboard setPropertyList:rowCopies forType:
PVMovedRowsType]);
NSLog(@"%@", pboard);
NSLog(@"%@", [pboard types]);
NSLog(@"%@", [pboard propertyListForType: PVMovedRowsType]); // read
the pasteBoard list with the type
return YES;
}
----------
2006-04-12 20:09:13.963 MyApp[14130] (<NSKVONotifying_ENSynthSong:
0x19d4e120>)
2006-04-12 20:09:15.859 MyApp[14130] 1
2006-04-12 20:09:15.859 MyApp[14130] <NSPasteboard: 0x19d60510>
2006-04-12 20:09:15.859 MyApp[14130] ("PV_MOVED_ROWS_TYPE")
2006-04-12 20:09:15.860 MyApp[14130] (null)
What happened to the property list that was just set??
Thank you for your help!
Tristan
_______________________________________________
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