Saturday, July 5, 2014

Lesson-1, Hello World Program


What you need?

  1. A MAC OR PC running XCODE
  2. GCC compiler installed

 First Hello World Program

#import <Foundation/Foundation.h>
      int main (int argc, const char *argv[])
      {
          NSLog (@"Hello, Objective-C!");
          return (0);
      } // main

 How to Run the program?

  • Save the program using Command + S
  • Run the program using Command + R
#import <Foundation/Foundation.h> 
That is simply means, we are telling that compiler we are using the Foundation Framework, which is collection of parts headers, images, libraries etc.

 NSLog (@"Hello, Objective-C!");
NSLog is a statement that is used to display string on the screen like pritnf() in C programming. 
 
 
 

No comments:

Post a Comment