如何将核心图转换为ARC

如何将核心图转换为ARC

本文介绍了核心图和Xcode 5.1-如何将核心图转换为ARC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了Xcode 5.1,发现它肯定需要项目才能使用ARC.我知道了

I just installed Xcode 5.1 and found that it definitely requires projects to use ARC. I get

error: garbage collection is no longer supported

当尝试编译Core Plot(1.4版)时.出于好奇,我告诉Xcode将Core Plot转换为ARC.但是失败了

when trying to compile Core Plot (version 1.4). Out of curiosity I told Xcode to convert Core Plot to ARC. But it fails with

ARC forbids Objective-C objects in struct

文件CPTPlatformSpecificFunctions.m中的

.我不想深入研究Core Plot并通过尝试修复此错误或类似错误来破坏某些内容.有没有我忽略的编译器设置?还是不久就会有使用ARC的Core Plot版本?谢谢,德克

in file CPTPlatformSpecificFunctions.m. I don't want to dive into Core Plot and break something by trying to fix this or similar errors. Is there a compiler setting I have overlooked? Or will there be a Core Plot version which uses ARC soon?Thanks,Dirk

推荐答案

Xcode 5.1不需要项目使用ARC,它最终放弃了对垃圾收集的支持. Core Plot从来不是严格的垃圾收集框架,但它确实支持构建垃圾收集.

Xcode 5.1 doesn't require projects to use ARC, it just finally drops support for garbage collection. Core Plot was never a strictly garbage-collected framework, but it did support building for garbage collection.

打开Core Plot项目时,出现该对话框时,您可以单击不立即"选项,然后转到项目构建设置.清空或删除项目底部用户设置下的GCC_ENABLE_OBJC_GC设置,该项目将以手动引用计数目标的形式构建.在ARC或非ARC应用程序中完全可以使用.

You can click on the "Not Now" option when presented with that dialog on opening the Core Plot project, then go to the project build settings. Blank out or remove the GCC_ENABLE_OBJC_GC setting under the user settings at the bottom of the project and the project will build just fine as a manually reference counted target. That's perfectly usable within an ARC or non-ARC application.

这篇关于核心图和Xcode 5.1-如何将核心图转换为ARC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 12:19