Re: CurrencyConverterTutorial.pdf
Re: CurrencyConverterTutorial.pdf
- Subject: Re: CurrencyConverterTutorial.pdf
- From: Jeff LaMarche <email@hidden>
- Date: Sun, 6 Jan 2002 20:56:26 -0800
Nobu:
The first two aren't to worrisome - they could indicate that you have
used the @Class keyword for the Converter class rather than importing
its header. They might indicate that there's a misspelling or type
mismatch in your arguments, but are only saying that something MIGHT be
wrong, not that something.
As for the second one, it's essentially the same thing. I'm suspecting
that you either haven't typed in the Converter class or for some reason
have used the @Class keyword rather than importing the Converter.h file.
If that's the case, then you can get around the error by casting your
message, something like this:
total = (float)[Converter convertAmount: amt atRate: rate];
If you have written Converter, I would recommend #importing its header
file, which should make these warnings and errors go away.
If you have written the Converter class and have #imported its header
and are getting this, then it means that there's something funky going
on. It could be just that you had mistyped the return value for the
convertAmount method, however.
Another possibility is that you have written the Converter class and
have imported it, but that you mistyped the name of the class or the
methods
If this doesn't help, let me know and I'll actually go look at the
CurrencyConverter tutorial.
Jeff
On Sunday, January 6, 2002, at 08:29 PM, Nobu wrote:
>
Hello, everyone.
>
I'm beginner Cocoa Environment. (and English too)
>
>
First, I read Currency Converter Tutorial.pdf document.
>
I tried make application following the document.
>
>
But, I got Error and Warning Message
>
>
Why?
>
Please teach me!
>
---
>
Compiling ConverterController.m
>
^ warning: cannot find class (factory) method.
>
^ warning: return type for 'convertAmount:atRate:' defaults to id
>
(s) incompatible types in assignment
>
--
>
- (IBAction)convert:(id)sender
>
{
>
float rate, amt, total;
>
amt = [dollarField floatValue];
>
rate = [rateField floatValue];
>
>
---Error--> total = [Converter convertAmount: amt atRate: rate];
>
>
[totalField setFloatValue:total];
>
[rateField selectText:self];
>
}
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.