Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Drag and Drop: Strange behavior with propertyListForType



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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.