Objective-C ARC Error: -fobjc-arc is not supported

2020-02-10 07:32发布

问题:

I'm having a problem trying to migrate my iPhone app to the new ARC technology. When I try to convert the code, the following error shows up 29 times:

 Apple LLVM compiler 3.0 Error
 -fobjc-arc is not supported with fragile abi

What does this mean? And more importantly, how can I fix it? Thanks in advance!

回答1:

From Apple's developer forums

This is an unfortunate bug in Seed 3, where the migrator and simulator aren't working well together. To address this, just switch to a device target, then do migration.



回答2:

change compiler.

Set the project compiler to "LLVM GCC 4.2", instead of "Apple LLVM 3.0"; ARC is only supported when you use Apple LLVM. To set the project compiler, in your Project, under "Build Settings", and then under "Build Options", there is a settings for "Compiler for Objective-C". Change that value to "LLVM GCC 4.2