Objective C is a programming language, which is sleeted
by Apple for developing the application for iPhone and Mac systems. Here we are
providing easy to learn Objective C tutorials. We will be explaining the
programming language with easy to learn examples. You will find these Objective
C tutorials very useful in gaining the core concepts easily and in very less
So, let's get started with Objective C.
Objective C Tutorial
About the Objective C tutorial presented here. In this complete guide of
Objective C you will be learning the programming concepts by doing the
coding. We follow the learn by doing concepts.
This section provides you the basic introduction about Objective C
programming language. Objective C is very old programming language and it
was designed and developed in 1980. Now Objective C has become popular once
again as it is being used by Apple to developing applications for Mac system
Why Objective C?
In this section we will learn about the importance of Objective C and "Why
Objective C?" is used as programming language to develop
applications for Mac System and iPhone.
In this section you will learn how to use Objective C on Windows machine. We
will download and install Objective C Windows compiler. On windows GNU C
compiler can be used to compile the Objective C program.
Objective C on
I this section we will show you how to compile and run Objective C program
on Mac machine.
In this section we will show you how to compile Objective C program on
windows and Max OS x machine. Compiling Objective C program is necessary as
it generates the executable program that can run.
Objective-C is a superset of C language, so program written in c and C++ should
compile as objective-c.
Message Expressions and comments Like C and C++ objective-C provides comments.
Programmer can use single or multi line comments in the code according to the
Message expressions are enclosed in square brackets.
Class and Method declaration and definitions
Because of objective-C is the extension of ANSI-C and it follows an object
oriented approach so provides classes and objects. The way to declare and define
classes and creation of object is little bit different from C and C++.
Objective-C program with multiple parameter
Objective-C enables programmer to use method with multiple parameter. These
parameter can be of same type or of different type.
This is a sample program that shows sum of three numbers as output.
Objective-C enables user to define constructor with the help of self and super
keywords. Like java Objective-C has parent class and programmer can access its
constructor by statement [super init], this statement returns a instance
of parent class which we assign to the 'self' keyword, actually 'self' plays
same role as this keyword in C++ and Java.
Access Modifiers and Garbage Collection
Previously it was a requirement to allocate and release memory manually to
assist with this problem it provides a reference-counting memory management
system through retain and release keywords.
access Objective-C provides facility of class level
access. In the examples given above we have used '-' sign before method, '-'
means instance level access. Now we will see how to define method that can be
access on class level.
Exception handling in Objective-C
Objective-C provide exception handling to handle exceptional conditions so that
code can be easier to write, easy to detect exceptions in the code and easier to
maintain as well. To take support of exception handling make sure the -fobj-exceptions
flag is turned on.
Objective-C enables programmer to inherit common methods and properties from
other class, known as inheritance. Class from methods and properties are
inherited known as Base Class and class that inherits known as Derived Class.
Dynamic Types in Objective-C
Objective-C provides many methods to work with
dynamic types. With these methods programmer can check that object is of the
given class or not, given method is member of the given class or not etc.
Objective-c Dealloc When an object contains another objects so before deallocation programmer
needs to release all those objects. This example shows how to use method dealloc,
when you want to deallocate an object that has already some other objects
When programmer wants to add some more
functionality to the class, typically extend the class. But this is not a right
way everywhere, so like ruby Objective-C also provides categories to achieve
Posing Posing is similar to category but it works a little bit different with the
category. It enable programmers to pose subclass to super class globally. When
subclass posed on super class method which are same in both classes are override
with the subclass methods.
March 10, 2011
Writing in Objective-C on Windows
- We have one more solution to add to the list. Rhohub allows you to write native apps in Objective-C using your Windows machine. In this demo you can see just how quick and easy it is: http://rhomobile.com/iphone-development-windows/ or check out www.rhohub.com to learn more. Plus, the basic subscription is free.
November 10, 2011
command not found is occuring while compiling the program
November 16, 2011
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database. this is the actual question please send everything in detail along with the description.
December 4, 2011
i need some objective of c language
June 12, 2012
what is is the major difference between c programming and objective c ?
July 23, 2012
Hi..this is a good tutorial on objective C. This will surely help u to get started in d iPhone apps development. Thx a lot !
August 8, 2012
iam looking to learn ios what is the basic to learn objective c.could u suggest me before learning objective c what shoud i learn .