How to remove ARC from iPhone project for iOS 5?

Now I have an Xcode project that is built for iOS 5, but now I need to install it on the iPhone 3GS, which has an older iOS. I found out that this is because I use ARC in this project and it is not available in iOS 3.2. How to remove ARC from my current project?

+4
source share
4 answers

If you want it to be disabled for the whole project, you need to go to the settings of the target assembly and set it to No enter image description here

+7
source

enter image description here itโ€™s very easy to first go to the targets that go โ€œbuldphasesโ€ โ†’ compileSource โ†’ here โ€œ yourfile.m โ€ โ†’ set the value to fno-objc-arc (only certain files)

If you want to remove ARC in the whole project, go to the targets in this direction "buldsettings" ---> objective-c automaticrefcount: NO

enter image description here

+5
source

In Xcode, there is a global compiler flag named -fobjc-arc . If you disable this ( -fno-objc-arc ), ARC will be disabled throughout the project. If only a few files do not support ARC, use the -fno-objc-arc flag only for these files. The last flag wins, see http://clang.llvm.org/docs/AutomaticReferenceCounting.html#general .

However, make sure you know what you are doing! If the project was designed around ARC, there cannot be any release code, including dealloc methods. In addition, your properties may be unsupported ( strong , weak , etc.). You are likely to be in complete disarray.

The best thing is to just upgrade your 3GS.

+1
source

Go Build settings make sure that the "all" option is selected search for automatic search Objective-c Automatic set of reference counters NO

+1
source

Source: https://habr.com/ru/post/1401978/


All Articles