• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Compiler bug?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >Re: Compiler bug? (From: Scott Ribe <email@hidden>)
 >Re: Compiler bug? (From: Ken Tozier <email@hidden>)

  • Prev by Date: Re: Compiler bug?
  • Next by Date: Re: Compiler bug?
  • Previous by thread: Re: Compiler bug?
  • Next by thread: Re: Compiler bug?
  • Index(es):
    • Date
    • Thread