Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)



Yes, by implementing these two methods from NSTableDataSource protocol in your data source class, to display data in the table:

1) numberOfRowsInTableView:
2) tableView:objectValueForTableColumn:row:

When the table "wants" to display itself, it will call these two methods to display each cell in the table. When the method "tableView:objectValueForTableColumn:row:" is called, you can identify the cell to display by getting the column identifier and row number. You then return the value to be displayed in the cell.

You let the table instance in Interface Builder know about your data source class by instantiating the data source class in Interface Builder. Then draw a connection from the table to the data source, and select "dataSource" as an outlet.

Chapter 9 of "Learning Cocoa with Objective-C (second edition)" has a table example.

More info:

<http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Protocols/NSTableDataSource.html#// apple_ref/occ/cat/NSTableDataSource>

On Jan 30, 2005, at 12:07 PM, Falko A. wrote:

My data source has to know about the index of a column to return it's data.
Is there any way to query a column for its index/position in the tableView?

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >(no subject) (From: "Falko A." <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.