Changes

Jump to: navigation, search

An Overview of Objective-C Functions

6 bytes added, 20:04, 19 November 2009
no edit summary
* '''<return type>''' - Specifies the data type of the result returned by the function. If the function does not return a result then ''void'' should be specified. Unless otherwise specified, functions are assumed to return an ''int''.
* '''<function name>''' - The name assigned to the function. This is the name by which the function will be referenced when it is called from with within the application code. Note that, unless otherwise specified using the ''static'' specifier, function names are global and must be unique within the context of an application to avoid compilation errors.
* '''<argn type>''' - The type of the argument passed through to the function.
== The ''main()'' Function ==
If you have been reading this book sequentially, you will have noticed that many of the examples in previous chapters have contained a function called ''main''. THis This is a special function name that tells the Objective-C compiler where to start program execution. If you do not have a main function your code will fail during the link phase of the build process. The syntax for a main function is as follows:
<pre>

Navigation menu