• 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: Parts of a Method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Parts of a Method (From: Brendon Bruns <email@hidden>)

  • Prev by Date: Parts of a Method
  • Next by Date: Re: Parts of a Method
  • Previous by thread: Parts of a Method
  • Next by thread: Re: Parts of a Method
  • Index(es):
    • Date
    • Thread