我正在尝试在NSTableView
由NSArrayController
. 我的copy:
方法如下所示:
- (IBAction)copy:(id)sender {
if (self.arrayController.selectionIndexes.count > 0) {
NSPasteboard *pasteboard = [NSPasteboard generalPasteboard];
[pasteboard clearContents];
NSArray *copiedObjects = self.arrayController.selection;
[pasteboard writeObjects:copiedObjects];
}
}
当我尝试执行复制时,访问控制器的选择时出错,因为它返回一个代理对象:
-[_NSControllerObjectProxy countByEnumeratingWithState:objects:count:]: unrecognized selector sent to instance 0x7f88b362d580
如何获得实际选定的对象?