错误信息(默认Helloworld出现):
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSZone.h:57:22: error: 'CFMakeCollectable' is unavailable: not available in automatic reference counting mode [3]
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:173:13: error: use of undeclared identifier '__bridge_retain' [3]
解决方案:
Important: In iOS 5 seed release 2, the compiler and header files are out of sync, causing compile time errors for ARC applications. To fix this, you must change header files in the platform SDK:
In System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h, change:
CFTypeRef CFMakeCollectable(CFTypeRef cf) CF_AUTOMATED_REFCOUNT_UNAVAILABLE;
to:
CFTypeRef CFMakeCollectable(CFTypeRef cf);
In System/Library/Frameworks/Foundation.framework/Headers/NSObject.h, change:
return (__bridge_retain CFTypeRef)X;
to:
return (__bridge_retained CFTypeRef)X;
具体内容可以参考ARC Programming Guides。 当然你可以通过在工程属性中禁用ARC就可以了。