views:

52

answers:

1

I've two TableViews (one SourceList and one Normal TableView). I'm not using ArrayControllers, just using:

- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
            row:(NSInteger)rowIndex;

- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView;

this to display the Row Contents. But the Problem is that I have not only one TableView - I've more than one. So I have added another NSObject with this Codes inside. But the Content wont show.

Must I use ArrayControllers? Or can I show the Content of the Second TableView in another way?

A: 

You don't have to use array controllers. In fact, they didn't even exist for most of Cocoa's life. The data source protocol works just fine (even better in some cases).

You can have separate controllers (one for each table) of course, but note you get a reference to the table view in each of the data source and delegate methods (aTableView in your source above), so you can give a different response depending on the table view. This way one controller can be responsible for both tables in your master/detail UI. In other words:

Table View: "What's column A of row 3?"

Your Controller: "Who's asking?"

Regarding your data not showing, did you instantiate your second controller and connect the problem table's data source to it? Did you ask the table to -reloadData? It's hard to help you with the limited information you've given.

Joshua Nozzi
First of all thank you for your answer - this Idea was in my mind to. But i was not able to develop it :S Yes My second controller is the DataSource of my Second TableView, but no i dont do a reloadData
ahmet2106
Calling -reloadData is necessary to get the table view to display its data when using the < NSTableViewDataSource > protocol.
Joshua Nozzi