I am trying to get this sorted out. I know how to get an ARC project working with files or static lib's that are not using ARC. For instance, using the compiler flags -fno-objc-arc.
我试图解决这个问题。我知道如何让ARC项目使用不使用ARC的文件或静态库。例如,使用编译器标志-fno-objc-arc。
But what if I have a project that is not using ARC and want to include a static library compiled with ARC? Every time I want to build the project it is telling me that it doesn't recognize things like "strong, __unsafe_unretained,...".
但是,如果我有一个不使用ARC的项目并希望包含一个使用ARC编译的静态库,该怎么办?每当我想要构建项目时,它告诉我它不会识别诸如“strong,__ securefun_tareined,......”之类的东西。
2 个解决方案
#1
8
It should work fine - are you sure you're using the newest Apple compiler with this non-ARC project and not the GCC one?
它应该工作正常 - 你确定你使用最新的Apple编译器与这个非ARC项目而不是GCC项目吗?
#2
16
To add on to shw's answer. Add -fobjc-arc to compiler flags under build phases to ARC files to make them compile correctly for non-ARC projects.
添加到shw的答案。将-fobjc-arc添加到ARC文件的构建阶段的编译器标志,以使它们能够针对非ARC项目正确编译。
More info here
更多信息在这里
#1
8
It should work fine - are you sure you're using the newest Apple compiler with this non-ARC project and not the GCC one?
它应该工作正常 - 你确定你使用最新的Apple编译器与这个非ARC项目而不是GCC项目吗?
#2
16
To add on to shw's answer. Add -fobjc-arc to compiler flags under build phases to ARC files to make them compile correctly for non-ARC projects.
添加到shw的答案。将-fobjc-arc添加到ARC文件的构建阶段的编译器标志,以使它们能够针对非ARC项目正确编译。
More info here
更多信息在这里