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. Ch1  Get started with Object C on Mac OS X

 

2.1  First 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"

 

相关文章:

  • 2021-07-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-09
  • 2022-02-27
  • 2021-11-25
猜你喜欢
  • 2022-12-23
  • 2021-10-23
  • 2021-11-21
  • 2021-12-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案