2_Objective-C Functions

  • A function is a group of statements that together perform a task.
  • There is one C function, called main()
  • All of the most trivial programs can define additional functions.

Function Declaration

A function declaration tells the compiler about a

  • function’s name
  • return type
  • parameters.

Function Definition

A function definition provides the actual body of the function.

Note

  • in Objective-C, we call the function as method.
  • The Objective-C foundation framework provides numerous built-in methods that your program can call
  • A method is known with various names like a function or a sub-routine or a procedure, etc.

Examples

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: