Under automatic reference counting, why are retain, release, and dealloc not allowed?

前端 未结 4 1643
忘掉有多难
忘掉有多难 2020-11-28 10:08

When trying to use -retain, -release, and -dealloc while building my application using automatic reference counting in Xcode 4.2, I ge

4条回答
  •  盖世英雄少女心
    2020-11-28 10:57

    Under automatic reference counting, retain, release, and dealloc are not allowed.

    If you have an existing code, you can keep using it as is with the -fno-objc-arc you can selectively disable ARC on any file.

    If you want to disable ARC on MULTIPLE files:

    Select desired files at Target/Build Phases/Compile Sources in Xcode PRESS ENTER. (double click selects only one file) Type -fno-objc-arc Press Enter or Done

提交回复
热议问题