Question

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

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

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

Was it helpful?

Solution

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.

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.

OTHER TIPS

If you import the static library you can use core plot in ARC projects. I'm doing so in my ARC app now. Here is a link to the instructions on how to do this:

http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications

All you need is the library "...core-plot-master/build/Debug-iphoneos/" is where I found it. And then import the headers which can be found in the "....core-plot-master/framework/source" folder. Then follow the directions.

Hope that helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top