问题
I do have Objective-C Automatic Reference Counting set to YES, but I have Objective-C Garbage Collection set to Unsupported
So I don't see how -fobjc-gc could be getting set. Is there something else that also sets it that I haven't noticed? I've tried a clean build, so it's not something sticking around.
回答1:
I found the answer, indirectly, thanks to this question. It turns out, that to get rid of garbage collection, I need to BOTH turn off garbage collection in the compiler settings when I click on Build Settings under the Project, and under the Target. If they disagree, the target (which is the one I didn't notice) overrides. No amount of playing with the settings at the project level was fixing that.
来源:https://stackoverflow.com/questions/10239116/clang-error-cannot-specify-both-fobjc-arc-and-fobjc-gc