如何用代码手工创建NSTableView
- NSWindow *window; // 也可以是你自己的窗口
- NSView *superView = [window contentView];
- NSTableView *tableView = [[NSTableView alloc] initWithFrame:[superView frame]];
- [tableView addColumn:[[NSTableColumn alloc] initWithIdentifier:@"field1"]];
- NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:[superView frame]];
- [scrollView setDocumentView:tableView];
- [superView addSubview:scrollView];