ARC: Setting compiler flags to -fno-objc-arc and build errors

旧时模样 提交于 2019-12-18 04:59:10

问题


Following a stackoverflow topic about disabling ARC compiler mechanism for specific classes, I added the -fno-objc-arc argument to Compiler Flags column under Compile Sources section (Buil Phases tab within TARGETS project). Even if settings have been validated, I'm not able to build my application since the compiler says that retain, release, etc. cannot be used under ARC.

How can I fix the above problem? Thank you in advance.


回答1:


Did you use the migration tool to perform your migration? Did you add the compiler flags to all the files that has release/retain?

I wrote about ARC migration on my blog here.




回答2:


Yes Thats true if you are using the ARC For iphone Application. You can not use manually retain, release, etc. .these messages automatically placed by the complier. You should check your code properly that for which classes you get error. I think so,you are still using retain, release, etc. for ARC enabled Classes. So Firstly check your classes,in which that error Occurred.



来源:https://stackoverflow.com/questions/9498644/arc-setting-compiler-flags-to-fno-objc-arc-and-build-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!