开发者

Data is not displayed in the table

开发者 https://www.devze.com 2023-03-05 14:29 出处:网络
I have created a small application,in which i have draged and droped a N开发者_运维问答STableView onto the window and binded to an datasource, in the datasource i have created NSMutableArray and added

I have created a small application,in which i have draged and droped a N开发者_运维问答STableView onto the window and binded to an datasource, in the datasource i have created NSMutableArray and added 2 records to it. And also defined methods numberOfRowsInTableView and rest of the methods. When i run the application it is showing the rows but the data is not displaying.


So. You've connected your table view's datasource outlet to some controller object that adopts NSTableDataSource protocol.

You mention numberOfRowsInTableView, which tells the table how many rows it should expect but lump together the "rest of the methods." One of those other methods is exactly responsible for showing the data for a given row and column.

What seems to be happening is this:

Table: "How many rows we got here?"

Data Source: "Three."

Table: "Gimme the object to display at row 0, column 0."

Data Source: [ sound of crickets chirping ]

You should probably post the exact code you're using for your implementation of the tableView:objectValueForTableColumn:row: method. Remember to include the method signature itself, given its importance in being recognized as the selector the protocol is looking for.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号