Re: Problem writing unit tests - "Incompatible types in initialization"
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