我有一个 OSX 应用程序,我想将其迁移到 ARC。如果我将基础 SDK 设置为 10.7,则一切正常。但是当我将其设置为 10.6 时,它不起作用(因为它找不到 _objc_release 等)。那么如何将我的应用程序部署到启用 ARC 的 10.6 版本?
最佳答案
您将 SDK 设置为 10.7,但将部署目标设置为 10.6。
请记住:
While it's possible to build programs using ARC that run on Mac OS X 10.6 and iOS 4, zeroing weak references are not available on those OSes. All weak references must be __unsafe_unretained here. Because non-zeroing weak references are so dangerous, this limitation significantly decreases the attractiveness of ARC on those OSes in my view.
关于cocoa - 如何在启用 ARC 的情况下部署到 Snow Leopard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7696201/