Re: multiple table views
Re: multiple table views
- Subject: Re: multiple table views
- From: Nick Zitzmann <email@hidden>
- Date: Tue, 22 Apr 2003 18:09:38 -0700
On Tuesday, April 22, 2003, at 05:44 PM, Francisco Tolmasky wrote:
Currently my document class contains 5 different table views (with no
more than 2 visible at any given time). my data source/delegate
methods are beginning to get kind of sloppy. For example:
- (id)tableView:(NSTableView *)aTableView
objectValueForTableColumn:(NSTableColumn *)aTableColumn
row:(int)aRowIndex;
{
if(aTableView==_someTableView)
{
do stuff, return stuff;
}
else if(aTableView==_someOtherTableView)
You could simplify this by using switch, like this:
switch (aTableView)
{
case _someTableView:
do stuff, return stuff;
break;
case _someOtherTableView:
do other stuff, return stuff;
break;
default:
do some stuff; this is where the "table view is none of the
above" stuff goes;
break;
}
I'd recommend reading "The C Programming Language" (2nd edition) by
Brian W. Kernighan and Dennis M. Ritchie. It's very useful as a C
reference, and was written by the two guys who created the language...
Nick Zitzmann
AIM/iChat: dragonsdontsleep
Check out my software page:
http://dreamless.home.attbi.com/
"Building the future and keeping the past alive are one and the same
thing." - Metal Gear Solid 2
_______________________________________________
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.