1
我想使用NSTableView而不使用the NSTableViewDataSource Methods,但就像普通視圖一樣。 draggingEntered:
和draggingExited:
被調用,但是當我返回NSDragOperationCopy
時,我看不到綠色加鼠標指針,並且performDragOperation:
未被調用。NSTableView可以處理普通的拖放方法嗎?
我子類的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;
}
我試過了,否則'draggingEntered:'和'draggingExited:'不會被調用。 – Jim893