How to add ARC for specific file?

2020-02-08 05:36发布

I created a project without ARC. I want to use a third party SDK in my project. That SDK comes with ARC Support. So I want to add ARC for that third party files. I can disable ARC for all "MYProject" files by adding this flag into build phases like -fno-objc-arc.

But I may use large number of files. So it's better to add ARC for specific SDK only. So how to add ARC support for single or specific SDK files in XCode Project?

For Instance: I want to use Grid View. I'm adding GMGridView in my project and it comes with ARC support.

2条回答
我想做一个坏孩纸
2楼-- · 2020-02-08 06:05

You add compiler flags in Targets -> Build Phases -> Compile Sources

Compile source show all file that project contain.so please add -fobjc-arc to compiler flag by double clicking on it as show in below image.

enter image description here

查看更多
beautiful°
3楼-- · 2020-02-08 06:25

Add the flag -fobjc-arc to the files that you'd like to use ARC. It's just the opposite of the other.

查看更多
登录 后发表回答