1_Program Structure

A Objective-C program basically consists of the following parts

  • Preprocessor Commands
  • Interface
  • Implementation
  • Method
  • Variables

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.

Preprocessor specifications 

  • 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.

Interface

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

  • interface
  • implementation.

What is the interface 

The section for defining the class name and methods

Implementation

The section for implementing class and methods

Method

Basically in Objective-C, we call the function as method function is a group of statements that together perform a task

Variables

A variable is nothing but a name given to a storage area that our programs can manipulate.

Example Program Structure

Foundation Framework

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.

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: