Re: Compiler bug?
Re: Compiler bug?
- Subject: Re: Compiler bug?
- From: Sean Murphy <email@hidden>
- Date: Fri, 12 May 2006 13:08:07 -0400
On May 12, 2006, at 12:37 PM, Ken Tozier wrote:
Could be just a syntax subtlety with "?:" I wasn't aware of, but the error stated the comparison (row[i] == NULL) was wrong, not the parts after the "?". At least that's how I was interpreting it.
Ken
Hi Ken,
The compiler warning is a bit confusing. Since it indicates a comparison problem, the obvious response would be to look at (row[i] == NULL), but there's nothing wrong there. The warning is actually referring to the fact that the two possible result expressions (null or NSNumber) have different types. When using the ?: operator, both results are required (and converted as necessary) to have the same result type. It is not possible at runtime to dynamically determine what type of value should be evaluated as the ultimate result of the ?: _expression_.
So, as Scott has done, just type cast the two resulting expressions to make them compatible.
-Murph |
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden