Objective-C Tutorial
Introduction
Objective-C is a superset of C programming language, which makes C object oriented.
- It was developed by Brad J. Cox at Stepstone Corporation in early 80’s, by adding Smalltalk-80 extensions to C-language.
- It was originally the main language on NextStep OS which was further adopted by Apple.
- It is used by Apple as a primary language to develop applications for MAC system and iPhone.
Objective-C, C and Smalltalk
Objective-C is an object oriented programming language that combines features of both, C and Smalltalk.
- Objective-C extends the procedural C-language with the addition of some new keywords and compiler directives, and uses Smalltalk style for sending messages to objects.
- The extension of C language into Objective-C is made possible by a runtime library (libobjc) that is generally transparent to the developer.
- It is possible to compile any C program with Objective-C compiler and therefore, code written in C-language can be freely included in any Objective-C class.
- Syntaxes of all non-object oriented operations in Objective-C are identical to that of C-language and object oriented operations are the implementation of Smalltalk style messaging.
Features of Objective-C
Being a derivative of C and Smalltalk, Objective-C comprises many features:
- It is an object-oriented version of C-language.
- It is a powerful language which is easy to learn and sophisticated to work with.
- Better understandability of code.
- Programmer can use both object oriented and procedural programming strategies as per the requirements.
- It provides open dynamic binding via Objective-C runtime library which makes it true object oriented.
- It also uses protocols for implementing multiple-inheritance.