Re: CurrencyConverterTutorial.pdf
Re: CurrencyConverterTutorial.pdf
- Subject: Re: CurrencyConverterTutorial.pdf
- From: Ricky Sharp <email@hidden>
- Date: Sun, 6 Jan 2002 23:00:00 -0600
On Sunday, January 6, 2002, at 10: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
---
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];
}
The error is because convertAmount isn't a class method of Converter.
Instead, it's an instance method. It thus needs to be sent to an
instance of the Converter class.
See your ConverterController.h file to see what the name of your
Converter instance is...your line of code then becomes:
total = [xxx convertAmount: amt atRate: rate];
where xxx is the name of your Converter instance.
Hope this helps,
___________________________________________________________
Ricky A. Sharp
mailto:email@hidden
Founder & President
Instant Interactive(tm)
http://www.instantinteractive.com