//新的写法
    @autoreleasepool {
         
        // insert code here...
        NSLog(@"Hello, World!");
         
    }
     
//旧版的写法
    /*
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     
    NSLog(@"Hello, Wolrd");
     
    [pool drain];
    return 0;
    */

 

 

编译XCode 4 以前的旧的的写法,则可以修改编译环境。

更改Object-C Automatic Reference Counting值为No即可