2

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

Dirk
  • 2,335
  • 24
  • 36

2 Answers2

12

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.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
0

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!

weezma2004
  • 203
  • 2
  • 12
  • I don't see why not. The library will just be in a different folder. I haven't developed any OSX apps so I'm not sure what the folder name will be. – weezma2004 May 06 '14 at 16:49
  • I tried it .. but when I including the `"corePlot.h"` it gives 15 errors: about `;` at the end of declaration ... I opened the files there are `;` at all the errored lines :-/ – Coldsteel48 May 06 '14 at 18:19
  • Based on the Plot_Gallery example project for Mac OS, you probably want to do: #import If that's not the issue... I'm not really sure what would be going on. Maybe difference of target platforms? – weezma2004 May 06 '14 at 19:00
  • I compiled it.. but there is no library .. there is only framewoks.h after compilation . inside the frameworks there is links to headers etc but there is no library ... I included the frameworks .. then it generates errors about `;` – Coldsteel48 May 08 '14 at 03:51
  • After you compile the Mac version of the example project, go to: projectFolder/Binaries/MacOS/ and then copy CorePlot.framework to your project. Then you should be able to import in the files you need reference. I have not tested it because I don't have my own project that's for MacOS. I'm merely going off of what I see here: https://github.com/core-plot/core-plot/wiki/Using-Core-Plot-in-an-Application – weezma2004 May 09 '14 at 17:55
  • I tried it . (I am able to `import ` but it generates awful errors :( ... I failed to make the build Phase , I can't find aplication targets in IDE xcode , however I don't think it is a problem because I compiled it. dunno maybe you can tell me where is the aplication targets located in xcode 5.1 ? – Coldsteel48 May 10 '14 at 13:51