gpt4 book ai didi

ios - 如何将Manual Retain-Release代码自动转换为ARC?

转载 作者:可可西里 更新时间:2023-11-01 03:27:31 27 4
gpt4 key购买 nike

我为 iOS 4 编写了数千行代码。代码库包含许多对 retainrelease 的调用,当项目更新到 iOS 5 时会导致错误和 ARC。

有没有办法自动将手动保留释放 (MRR) 代码转换为自动引用计数 (ARC)?

最佳答案

来自 Xcode 4.2 release notes :

To initiate the process, enable Continue building after errors in the General Preferences pane, then choose Edit > Refactor > Convert to Objective-C ARC. The targets that you convert are updated to build using the Apple LLVM compiler. Xcode attempts to build your target and to determine what changes must be made to use ARC. If it finds any issues that prevent conversion, Xcode displays a dialog directing you to review the errors in the Issue navigator. After you correct the errors, choose the Convert to Objective-C Automatic Reference Counting menu item again to restart the ARC-conversion workflow.

关于ios - 如何将Manual Retain-Release代码自动转换为ARC?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7874727/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com