• 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: Incompatible types in Currency Converter tutorial
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Incompatible types in Currency Converter tutorial


  • Subject: Re: Incompatible types in Currency Converter tutorial
  • From: Greg Norz <email@hidden>
  • Date: Fri, 18 Nov 2005 13:49:17 -0800 (PST)

Phil,

Thanks for the reply. I knew it was something stupid!
I actually had the case wrong in the .m file :

rate = [rateField floatvalue];

I've stared at this code on and off for the last day
and wasn't able to catch that! Only when I went to
post the code in reply did I notice the error.

Thanks again. Being a seasoned C++ developer,
hopefully I don't make too many more dumb mistakes
like that! :^)

greg

--- Phil Frost <email@hidden> wrote:

> 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
>





__________________________________
Yahoo! Mail - PC Magazine Editors' Choice 2005
http://mail.yahoo.com
 _______________________________________________
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

References: 
 >Re: Incompatible types in Currency Converter tutorial (From: Phil Frost <email@hidden>)

  • Prev by Date: Re: Incompatible types in Currency Converter tutorial
  • Next by Date: Re: URL loading system not threadsafe?
  • Previous by thread: Re: Incompatible types in Currency Converter tutorial
  • Next by thread: Fetching entities where optional attribute is set
  • Index(es):
    • Date
    • Thread