错误信息(默认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就可以了。
本文介绍了解决iOS5 seed版本中出现的自动引用计数(ARC)编译错误的方法。具体步骤包括修改CoreFoundation.framework和Foundation.framework下的头文件,并提供禁用ARC的替代方案。
577

被折叠的 条评论
为什么被折叠?



