XCode 8.2 编译NSAutoreleasePool的问题
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
//新的写法 @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即可
近期评论