How to remove ARC from XCode

后端 未结 3 1976
深忆病人
深忆病人 2021-02-10 03:29

I have already created a project in XCode 4.2 with ARC checked. The problem is that I have to download and add the ASIHttpRequest files. This is giving a whole bunch of errors w

相关标签:
3条回答
  • 2021-02-10 03:38

    Click on the name of the project on the navigation view in the left side, go to Targets -> Build Phases and add -fno-objc-arc to the "compiler flags" for any relevant files.

    0 讨论(0)
  • 2021-02-10 03:44

    You can turn off ARC per-file by passing the flag -fno-objc-arc to each as they are compiled. Add the flag to the files that need ARC disabled in the Compile Sources group under the target in the project navigator.

    Another option would be to compile ASIHttpRequest as its own framework that doesn't have ARC enabled and just link against the framework. Speak of, isn't ASIHttpRequest already in a framework? (I've not looked at it in a while)

    0 讨论(0)
  • 2021-02-10 03:45

    Keep using ARC, but disable it for the ASIHttpRequest files. This answer should point you in the right direction:

    How can I disable ARC for a single file in a project?

    0 讨论(0)
提交回复
热议问题