Objective-C Hello World实例 发表于 2025-06-03 更新于 2025-06-06 分类于 技术 阅读次数: 这里示范一个基础的Hello World程序。 12345678910#import<Foundation/Foundation.h> int main(int argc, char *argv[]){ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSLog(@"Hello World!"); [pool drain]; return 0;} 以上是Xcode的旧版”Hello World”程序代码,在4.3.1 xcode的代码为: 12345678#import <Foundation/Foundation.h> int main(int argc, char *argv[]){ @autoreleasepool{ NSLog(@"Hello World!"); } return 0;}