I’m just going to familiarize myself with what an NstableView wants:

Simple things, but because it was a pit for a few days; (, therefore recorded.

The development environment is Xcode 6.

Operation work. It’s not nice. Because you need to select it in the Xcode Interface Builder.

  • So I’m going to drag the NstableView onto the interface.

  • Point the TableView’s DataSource to the App Delegate

  • Set the TableView’s ContentMode to Cell Based (1)

Back to the nice coding

Coding two implementations in AppDelegate.m.


- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView {
    return 1;
}

- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row;
{
    return @”a“;
}

(1): If you do not choose, the consequences are very serious, always do not show any content, even if the written code has been debugged. Well, I said it took me a few days to figure it out.

Adapted from a 90 after children: https://www.mgenware.com/blog/?p=2389 code: https://github.com/1000copy/appletech/tree/master/step10-tableview-xib