Re: Incompatible types in Currency Converter tutorial
Re: Incompatible types in Currency Converter tutorial
- Subject: Re: Incompatible types in Currency Converter tutorial
- From: Phil Frost <email@hidden>
- Date: Fri, 18 Nov 2005 15:57:13 -0500
On Fri, Nov 18, 2005 at 10:29:58AM -0800, Greg Norz wrote:
> I'm starting my first forray into Objective-C, and I'm stumped on
> what is probably a really basic error. In the Currency Converter
> tutorial, I am getting the following error :
>
> "error: incompatible types in assignment" on the following line :
>
> rate = [rateField floatValue];
>
> What puzzles me is the line above it is identical (save the variable
> names) and causes no problems. What am I missing here? I've poured
> over the code several times to make sure I got everything correct,
> and I'm just not seeing it. I can post my entire source files if
> that would help anyone, but I basically copied in verbatim from the
> PDF.
>
> Thanks,
> greg
What it means is that "rate" is of some type, and
"[rateField floatValue]" is of some other type, and the two are not
compatible.
Probably somewhere you declared rate to be of some type like one of
these:
id rate; // rate is of type "id"
int rate; // rate is of type "int"
SomeClass *rate; // rate is of type "SomeClass *"
[rateField floatValue] returns something of a type that is not
compatible with the type you declared "rate" to have. Check the API docs
to see what type it returns, and adjust your definition of "rate"
accordingly.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden