Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The NSLog routine is an example of a function that you have used in every program so far. Indeed, every program also has used a function called main. Let’s go back to the first program you wrote (Program 2.1), which displayed the phrase “Programming is fun.” at the terminal:
#import <Foundation/Foundation.h>
int main (int argc, char *argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@"Programming is fun.");
[pool drain];
return 0;
}