Re: Why use protocols?
Re: Why use protocols?
- Subject: Re: Why use protocols?
- From: Matt Neuburg <email@hidden>
- Date: Thu, 19 May 2005 12:47:25 -0700
On Wed, 18 May 2005 20:03:05 +0200, Ondra Cada <email@hidden> said:
>@implementation MyTableColumn
>-dataCellForRow:(int)row {
> id ds=[[self tableView] dataSource];
> if ([ds respondsToSelector:@selector(dataCellForRow:sender:)])
> return [ds dataCellForRow:row sender:self];
> return [super dataCellForRow:row];
>}
I completely agree in principle, and I do use this way too, but IIRC my
experience has been that the compiler warns (it doesn't know at compile time
that ds responds to dataCellForRow:sender:), whereas a formal protocol
prevents the warning... I may be misremembering, however.
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
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