Re: NSTableView
Re: NSTableView
- Subject: Re: NSTableView
- From: Larry Fransson <email@hidden>
- Date: Wed, 1 Dec 2004 01:09:08 -0800
On Nov 30, 2004, at 23:05, Amit Kumar(R&D) wrote:
But how the compiler will recognize that which data source belongs to which table.
I see the misunderstanding now.
You can serve multiple table views with a single data source object. You only write each data source function once. What you return from the function depends on which table view is asking for the data.
Consider a data source function like -numberOfRowsInTableView:. Note that the signature is - (int)numberOfRowsInTableView(NSTableView *)aTableView. The parameter "aTableView" is a pointer to the table view that needs to know how many rows are in the view. You write the code necessary to determine how many rows are in that particular table view, something like
if(aTableView == firstTableView) {
return thisInt;
}
if((aTableView == secondTableView) {
return thatInt;
}
Larry Fransson
Seattle, WA
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden