How do I handle multiple file drag/drop from Finder in Mac OS X 10.5?
Getting multiple filenames is easy: (While getting multiple URLs is not with 10.5)
- Register your view for
NSFilenamesPboardType
- In
performDragOperation:
do the following to get an array of file paths:
NSPasteboard* pboard = [sender draggingPasteboard];
NSArray* filenames = [pboard propertyListForType:NSFilenamesPboardType];
The IKImageKit programming topics
outline a way to do this like so (paraphrased):
NSData *data = [pasteboard dataForType:NSFilenamesPboardType];
NSArray *filenames = [NSPropertyListSerialization
propertyListFromData:data
mutabilityOption:kCFPropertyListImmutable
format:nil
errorDescription:&errorDescription];
See here: Image Kit Programming Guide: Supporting Drag and Drop