Use Automatic Referencing Count in specific classes in ios

拟墨画扇 提交于 2019-12-04 02:38:56

问题


Actually i came to this question when i was trying to add some classes that have been made upon ios prior to IOS 5 and these classes doesn't having ARC and the project i am trying to add is made upon the IOS 5 and it give me the compile time error related to ARC the classes having suck kind of information that if i try to remove the release/retain then it start behaving irregular.That is my problem, Now come to question i want to know that is there any way so that i can mark those classes not to use ARC so that the newly created classes that having base SDK ios5 compile with ARC and i mention not to use ARC simply compiled with their retain/release values.That is the only way i have left i think for making properly this app.

Any idea how i can use those classes that is having base sdk prior to ios5.

Thanks,


回答1:


the image below will show you how to do it.

-fno-objc-arc   flag to disbale arc 

-fobjc-arc      flag to enable arc




回答2:


Go to your project settings, under Build Phases > Compile Sources Select the files you want ARC disabled and add -fno-objc-arc compiler flags. You can set flags for multiple files in one shot by selecting the files then hit Enter key.




回答3:


Go to Issue Navigator -> Validate project settings -> Perform changes. In this way Xcode automatically remove release and retain keywords from whole project and convert into ARC compatible.



来源:https://stackoverflow.com/questions/9629820/use-automatic-referencing-count-in-specific-classes-in-ios

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