Re: CodeWarrior and Objective-C warnings
Re: CodeWarrior and Objective-C warnings
- Subject: Re: CodeWarrior and Objective-C warnings
- From: John Stiles <email@hidden>
- Date: Thu, 2 Dec 2004 02:21:27 -0800
On Dec 1, 2004, at 9:38 PM, Andrew Farmer wrote:
On 01 Dec 2004, at 16:42, John Stiles wrote:
I have code that looks like this
- (void)connection:(NSURLConnection *)connection
didReceiveResponse:(NSURLResponse *)response
{
if( [response respondsToSelector:@selector(statusCode)] )
{
if( [response statusCode] == 200 )
{
// stuff
}
}
}
When I call [response statusCode] in the code above, CodeWarrior
warns that "receiver cannot handle this message." Obviously this was
taken care of on the previous line, but I can see how a compiler
might not understand this :) How can I placate the compiler and
silence the warning (other than disabling warnings)?
Use GCC?
Seriously, Codewarrior's ObjC support kind of stinks, and I won't even
get into its PPC code generation. (*retch*)
If you're being forced to use Codewarrior, though, I'd advise getting
rid of the respondsToSelector (as it's really just a waste of time -
assuming that this is a delegate method, the NSURLResponse will
_always_ respond to statusCode) and adding something along the lines
of:
#warning Please ignore the following warning.
You get the distinct honor of being Least Helpful Of Thread.
Congratulations! There were lots of good, usable suggestions--posted
hours and hours ago! :)
CW9 is great for ObjC. CW8 sucked, fine, that's old news. And FWIW, in
every test we've run, CodeWarrior generates apps that run as fast or
faster than GCC, and always compiles in less than half of the time. And
trust me, we've run our tests.
_______________________________________________
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