一個Object C 經典的hello world例子,在XCode 11版本里,報錯【'NSAutoreleasePool' is unavailable: not available in automatic reference counting mode】。
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog (@"hello world");
[pool drain];
return 0;
}
解決方法,如下圖: