• 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: Problem writing unit tests - "Incompatible types in initialization"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem writing unit tests - "Incompatible types in initialization"


  • Subject: Re: Problem writing unit tests - "Incompatible types in initialization"
  • From: Dave DeLong <email@hidden>
  • Date: Sun, 25 Oct 2009 14:13:29 -0600


On Oct 25, 2009, at 2:08 PM, Ian Piper wrote:

It also has a method called convertCToF that ... returns the converted temperature, also as a float.

NSNumber *newTemperatureInF = [testConverter convertCToF]; // This is where I get the error "Incompatible types in initialization"

An NSNumber (an object) is not the same thing as a float (a primitive). The latter is a raw numerical value, and the former is an object that encapsulates a numerical value.


Cheers,

Dave

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Problem writing unit tests - "Incompatible types in initialization"
      • From: Ian Piper <email@hidden>
References: 
 >Problem writing unit tests - "Incompatible types in initialization" (From: Ian Piper <email@hidden>)

  • Prev by Date: Problem writing unit tests - "Incompatible types in initialization"
  • Next by Date: Re: Problem writing unit tests - "Incompatible types in initialization"
  • Previous by thread: Problem writing unit tests - "Incompatible types in initialization"
  • Next by thread: Re: Problem writing unit tests - "Incompatible types in initialization"
  • Index(es):
    • Date
    • Thread