How to enable/ disable “Automatic Reference Counting”?

前端 未结 3 547
难免孤独
难免孤独 2020-12-15 16:32

Using Xcode 4.2, how can one enable/disable \"Automatic Reference Counting\"?

ANSWERED Under Build Settings, flip \"yes\" and \"no\" depending whet

相关标签:
3条回答
  • 2020-12-15 17:07

    In XCode 4.6 this property has now changed to CLANG_ENABLE_OBJC_ARC

    XCode 4.6 enabling Obj-C Automatic Reference Counting property

    0 讨论(0)
  • 2020-12-15 17:09

    Globally:

    Go to "Build Settings", look for "Apple LLVM compiler 3.0 - Language". Set the field "Objective-C Automatic Reference Counting" to "No".

    enter image description here

    For individual files:

    Go to "Build Phases", select the file, double-click the "Compiler Flags" column and put "-fno-objc-arc" in it.

    0 讨论(0)
  • 2020-12-15 17:12

    To enable ARC per-file, you can also set your "Compiler Flags" under "Build Phases" to -fobjc-arc. Make sure your compiler is set to Apple LLVM compiler 4.x and not LLVM GCC 4.2.

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