錯誤資訊(預設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就可以了。