Re: Doe each NSTableView requires its own controller?
Re: Doe each NSTableView requires its own controller?
- Subject: Re: Doe each NSTableView requires its own controller?
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 28 Jan 2004 00:00:18 -0800
On Jan 27, 2004, at 10:42 PM, email@hidden wrote:
In my application I'm about to add an additional NSTableView instance.
Do I now need to create a new controller to implement its delegate
methods?
No.
Most likely scenario: your controller will have two instance variables
(outlets), tableView1 and tableView2. Your controller will also
implement the NSTableView data source and delegate methods. The first
parameter in all of these is the table view sending the message. Your
implementations therefore check which tableview is sending the message
before returning the appropriate value.
e.g.
- (int)numberOfRowsInTableView:(NSTableView *)tableView
{
if (tableView == tableView1)
{
return [array1 count];
}
return [array2 count];
}
mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.