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: Ian Piper <email@hidden>
- Date: Sun, 25 Oct 2009 20:23:07 +0000
On 25 Oct 2009, at 20:13, Dave DeLong wrote:
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.
*Slaps forehead*. Thanks very much.
Ian.
--
_______________________________________________
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