我創建了NSViewController用於管理PXListView ....委託是有文件所有者連接...PXListView拖放是不是做工作
這裏一切工作爲每expectation..except拖放滴...
同時拖動它不進入拖動委託功能...和它沒有顯示的同時拖動(即拖動符號)+符號...和拖動細胞重新定位到其原始位置
#import "PXListView.h"
@interface ListViewController : NSViewController <PXListViewDelegate>
{
IBOutlet PXListView *listView;
NSMutableArray *_listItems;
int count;
}
- (void)addCell;
@end
- (BOOL)listView:(PXListView*)aListView writeCellsWithIndexes:(NSIndexSet*)rowIndexes toPasteboard:(NSPasteboard*)dragPasteboard
{
// +++ Actually drag the items, not just dummy data.
[dragPasteboard declareTypes: [NSArray arrayWithObjects: NSStringPboardType, nil] owner: self];
[dragPasteboard setString: @"Just Testing" forType: NSStringPboardType];
return YES;
}
- (NSDragOperation)listView:(PXListView*)aListView validateDrop:(id <NSDraggingInfo>)info proposedCell:(NSUInteger)row
proposedDropHighlight:(PXListViewDropHighlight)dropHighlight;
{
return NSDragOperationCopy;
}
- (BOOL)listView:(PXListView*)aListView acceptDrop:(id <NSDraggingInfo>)info row: (NSUInteger)row dropHighlight:(PXListViewDropHighlight)dropHighlight
{
NSLog(@"Accept Drop");
ListViewThumbnailObject *temp = [_listItems objectAtIndex: [listView selectedCell]];
[_listItems removeObjectAtIndex: [listView selectedCell]];
[_listItems insertObject: temp atIndex: row];
[listView reloadData];
return YES;
}
它沒有進入在「筆尖」文件委託相關的委託方法拖..
是有線與文件屬主...
任何人都可以請建議我如何解決這個問題?
感謝, MUTHU
現在拖放正在按預期工作... – mammaiap