Re: respondsToSelector - #import OR compiler warnings?
Re: respondsToSelector - #import OR compiler warnings?
- Subject: Re: respondsToSelector - #import OR compiler warnings?
- From: "Michael Ash" <email@hidden>
- Date: Tue, 30 Dec 2008 08:15:21 -0500
On Mon, Dec 29, 2008 at 11:49 PM, Steve Cronin <email@hidden> wrote:
> Folks;
>
> I have some methods which might be handled by one of several objects.
> So I have a set of if ( [objectX respondsToSelector:@selector(foo)] )
> {... } else if ( [objectY respondsToSelector:@selector(foo)] ) {... } ....
>
> The functionality is fine but the compiler warnings for "no 'foo' method
> found" bug me.
> Call me finicky if you want but I love spanking clean compiles.
Not finicky at all. There's a name for apps which ship full of
warnings: we call them "Buggy".
> But a full header import for the sake of a method or two seems onerous.
A common programmer problem is thinking about how difficult work is in
terms of how much work the computer has to do, rather than how much
work he has to do.
A "full header import" is a single (short) line to type. It's about
the minimum possible amount of work you can have to do anything. Don't
think about the thousands of lines you end up dumping into the source
file, think about the small number of characters you actually type to
solve your problem.
Mike
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden