Objective-C Overview



Objective-C is general-purpose language that is developed on top of C Programming language by adding features of Small Talk programming language making it an object-oriented language. It is primarily used in developing iOS and Mac OS X operating systems as well as its applications.

Initially, Objective-C was developed by NeXT for its NeXTSTEP OS from whom it was taken over by Apple for its iOS and Mac OS X.

Object-Oriented Programming

Objective-C fully supports object-oriented programming, including the four pillars of object-oriented development −

  • Encapsulation
  • Data hiding
  • Inheritance
  • Polymorphism

Example Code

#import <Foundation/Foundation.h>

int main (int argc, const char * argv[]) {
   NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

   NSLog (@"hello world");
   [pool drain];
   return 0;
}

Foundation Framework

Foundation Framework provides large set of features and they are listed below.

  • It includes a list of extended datatypes like NSArray, NSDictionary, NSSet and so on.

  • It consists of a rich set of functions manipulating files, strings, etc.

  • It provides features for URL handling, utilities like date formatting, data handling, error handling, etc.

Learning Objective-C

The most important thing to do when learning Objective-C is to focus on concepts and not get lost in language technical details.

The purpose of learning a programming language is to become a better programmer; that is, to become more effective at designing and implementing new systems and at maintaining old ones.

Use of Objective-C

Objective-C, as mentioned earlier, is used in iOS and Mac OS X. It has large base of iOS users and largely increasing Mac OS X users. And since Apple focuses on quality first and its wonderful for those who started learning Objective-C.

Advertisements