Explanation of Your First Program

Now that you are familiar with the steps involved in compiling and running Objective-C programs, let’s take a closer look at this first program. Here it is again:

// First program example#import <Foundation/Foundation.h>int main (int argc, const char * argv[]){   @autoreleasepool {      NSLog (@"Programming is fun!");   }   return 0;}

In Objective-C, lowercase and uppercase letters are distinct. Also, Objective-C doesn’t care where on the line you begin typing—you can begin typing your statement at any position on the line. You can use this to your advantage in developing programs that are easier to read.

The first seven lines of the program introduce the concept of the comment. ...

Get Programming in Objective-C, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.