Objective-C is an object-oriented programming language.
It is the main programming language used by Apple for the OS X and iOS operating systems and their respective APIs, Cocoa and Cocoa Touch.
#import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog (@"hello world"); [pool drain]; return 0; }
The following line in the code above include the foundation framework into our code.
#import <Foundation/Foundation.h>
Foundation Framework has libraries and features we can use.
It includes a list of extended datatypes like NSArray, NSDictionary, NSSet and so on.
Foundation Framework has a set of functions we can use to manipulate files, strings, etc.
We can also use Foundation Framework to do URL handling, date formatting, data handling, error handling, etc.
Objective-C source files use .m
as extension.
The following table lists other commonly used filename extensions.
Extension | Meaning |
---|---|
.c | C language source file |
.cc, .cpp | C++ language source file |
.h | Header file |
.m | Objective-C source file |
.mm | Objective-C++ source file |
.o | Object (compiled) file |