A Objective-C program basically consists of the following parts
- Preprocessor Commands
The Objective-C Preprocessor is not part of the compiler, but is a separate step in the compilation process.
Preprocessor is just a text substitution tool and it instructs compiler to do required pre-processing before actual compilation.
We’ll refer to the Objective-C Preprocessor as the OCPP.
- All preprocessor commands begin with a pound symbol (#).
- It must be the first nonblank character, and for readability.
- A preprocessor directive should begin in first column.
Befor understanding the interface we have to understand the OOP Concept
The main purpose of Objective-C programming language is to add object orientation to the C programming language
Classes are the central feature of Objective-C that support object-oriented programming and are often called user-defined types.
So now we know the classes but what is the relationship of class with interface
The class is defined in two different sections
What is the interface
The section for defining the class name and methods
The section for implementing class and methods
Basically in Objective-C, we call the function as method function is a group of statements that together perform a task
A variable is nothing but a name given to a storage area that our programs can manipulate.
In the previews example we use foundation framework to
- Provides large set of features
- It includes a list of extended datatypes
- It consists of a rich set of functions.
- It provides features for URL handling, utilities like date formatting, data handling, error handling, etc.