Trying to get this to work, and not sure what I'm missing. The idea is to drop images on a NSTableView
so that I can grab their paths and do some manipulations for them. I can get the drop to work for NSPastebouardTypeString
, but I cannot for the life of me get it to register dragging PNGs from Finder into the tableview. What am I missing?
Relevent code:
- (void)awakeFromNib {
[imageTableView registerForDraggedTypes:[NSArray arrayWithObject:NSPasteboardTypePNG]];
}
- (NSDragOperation)tableView:(NSTableView *)aTableView validateDrop:(id < NSDraggingInfo >)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)operation {
NSLog(@"Validate Drop");
return NSDragOperationEvery;
}
- (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id < NSDraggingInfo >)info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation {
NSLog(@"Accept Drop");
return YES;
}