zyllf2009 发表于 2015-12-30 14:35:05

Programming on Mac OS X

Programming on Mac OS X -- Learn Object-C Serials (1)
            Autodesk,Inc. Sun Wentao

  

  1. Reference book:
  Programming in Objective-C, by Stephen G. Kochan, October 30, 2003

  Cocoa® Programming for Mac® OS X, Third Edition, by Aaron Hillegass, May 05, 2008
  
  2. Ch1Get started with Object C on Mac OS X

  
  2.1First simple program in Object C


// First program example
#import <stdio.h>

int main (int argc, const char *argv[])
{
    printf ("Programming is fun.\n");
   
    return 0;
}  
  Notice for C/C++ programmers:


(1) #import instead of #include in ordinary C++ or C files;
(2) When building this kind of object-c file, *.m, use gcc like this:
gcc filename -o objectname -l objc  Option: -l objc means to specify current build language is "object c"

  
页: [1]
查看完整版本: Programming on Mac OS X