Re: Parts of a Method
Re: Parts of a Method
- Subject: Re: Parts of a Method
- From: Shawn Erickson <email@hidden>
- Date: Mon, 12 Aug 2002 23:05:59 -0700
On Monday, August 12, 2002, at 10:34 PM, Brendon Bruns wrote:
Here is a particular method from the Currency Converter project
tutorial
provided by Apple that is defined in the .h file:
- (float)convertAmount:(float)amt atRate:(float)rate;
Now, why would there be three "(floats)" in this method? I can see
that
(float)amt and (float)rate are both arguments that would hold a number
(I
believe argument is the correct word.) Is the first (float) referring
to
the type of value that is returned from the method?
Just as with C functions the first "float" specifies the return type
for the method (if it doesn't return anything the "void" would be used.
The other two "floats" specify the first and second arguments for this
method.
And is convertAmount:
atRate: just referring to the name of the method that is called by a
message?
You could think of it as the verbiage of the messages that invokes the
method.
-Shawn
_______________________________________________
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.