I am trying to add a table view to a view in code instead of using Interface Builder and unfortunately this causes some problems = (
Here is an example of how I am doing it now.
NSScrollView *scrollView = [[NSScrollView alloc] initWithFrame:someRect];
NSTableView *tableView = [[NSTableView alloc] initWithFrame: scrollView.bounds];
resultsTableView.dataSource = self;
resultsScrollView.documentView = tableView;
[someView addSubview: scrollView];
So basically I just put the tableView inside the scrollView (because that's what IB does) and then adds the latter as a subview of someView. As a result, a tableView appears, but the data is not displayed in the tableView. Debugging shows that the number of rows in the View table is set in the dataSource, but the method:
tableView:objectValueForTableColumn:row:
never called. I suspect this is due to my way of creating a tableView.
I tried google, but no luck, and the "Programming Guide in Table Presentation" also did not help in the "Madevcenter". What am I missing?
...