다음 대리자를 구현하여 NSTableView에서 끌어서 놓기를 지원했습니다. 위임자 validateDrop 및 acceptDrop이 호출되고 Finder에서 NSTableView로 내용을 끌어다 놓을 수 있지만 NSTableView에서 항목을 드래그하여 Finder에 놓으려고하면 writeRowsWithIndexes가 호출되지 않습니다. 내 NSTableView는에writeRowsWithIndexes가 사용자 지정 셀이있는 NSTableView에서 호출하지 않습니다.
- (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes:(NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard
{
NSLog(@"writeRowsWithIndexes");
return YES;
}
- (NSDragOperation)tableView:(NSTableView *)aTableView validateDrop:(id <NSDraggingInfo>)info proposedRow:(NSInteger)row proposedDropOperation:(NSTableViewDropOperation)operation
{
NSLog(@"validateDrop");
return NSDragOperationCopy;
}
- (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id <NSDraggingInfo>)info row:(NSInteger)row dropOperation:(NSTableViewDropOperation)operation
{
NSLog(@"acceptDrop");
return YES;
}
내가
//Registering dragged Types
[tableView registerForDraggedTypes:[NSArray arrayWithObjects:NSFilenamesPboardType, nil]];
//To support across application passing NO
[tableView setDraggingSourceOperationMask:NSDragOperationCopy forLocal:NO];
//Don't want any highlight selection on drop
[tableView setDraggingDestinationFeedbackStyle:NSTableViewDraggingDestinationFeedbackStyleNone];
드래그로 끌어 유형의 등록을 시작되지 않으며, 아무도 가능한 이유가 될 수 있는지 말해 줄래? 나는 TableView에 커스텀 셀을 가지고 있으며 델리게이트와 데이터 소스를 적절히 설정했다.
1. 히트 & 재판에 나는 그 드래그 만이 아닌 셀 내용 영역에 형성 세포 분리를 시작 확인했다. 2. 이미지 대리자 끌기도 호출되지 않습니다. - (NSImage *) dragImageForRowsWithIndexes : (NSIndexSet *) dragRows tableColumns : (NSArray *) tableColumns 이벤트 : (NSEvent *) dragEvent 오프셋 : (NSPointPointer) dragImageOffset –