我想使用没有NSTableViewDataSource 方法的 NSTableView,但就像普通视图一样。draggingEntered:
并且draggingExited:
正在被调用,但是当我返回时NSDragOperationCopy
,我没有看到绿色的加号鼠标指针,performDragOperation:
也没有被调用。
我用这些方法对 NSTableView 进行了子类化:
- (void)awakeFromNib
{
[self registerForDraggedTypes: [NSArray arrayWithObject: NSFilenamesPboardType]];
}
- (NSDragOperation)draggingEntered: (id < NSDraggingInfo >)sender
{
NSLog(@"draggingEntered"); //Gets called
return NSDragOperationCopy;
}
- (void)draggingExited: (id < NSDraggingInfo >)sender
{
NSLog(@"draggingExited"); //Gets called
}
- (BOOL)performDragOperation: (id < NSDraggingInfo >)sender
{
NSLog(@"performDragOperation"); //Doesn't get called
return YES;
}