xcode 5编译NSAutoreleasePool的问题

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



如果需要编译xcode4的写法,需要修改编译环境。

需要设置Object-C Automatic Reference Counting值为No

你可能感兴趣的:(xcode 5编译NSAutoreleasePool的问题)