2
votes

I'm having trouble using the Core Plot framework in my project. I tried following these steps from the core-plot site but xcode says that it cannot find "CorePlot-CocoaTouch.h".

I'm confused, I also tried this other tutorial, but encountered the same issue. Has anyone else successfully used Core Plot with Xcode 4.2? Any ideas of what may be cause of my errors? Thanks!

2
Are you using the source project from Mercurial or the packaged binary static library? How to provide the headers will differ based on how you're obtaining the framework. - Brad Larson

2 Answers

1
votes

I figure it out. I did this steps :

  • I copied the CorePlotHeaders directory in my project

  • I copied the libCorePlot-CocoaTouch.a to the project and under the frameworks group

  • Under the Target Build Settings for 'Other linker flags' I included : -ObjC

(-all_load used to be required as a linker flag, but this is no longer needed in Xcode 4.2)

  • I added QuartzCore framework to the project
  • I inserted in header file

    #import "CorePlot-CocoaTouch.h"

But anyway this will give the error (about Xcode can not find CorePlot-CocoaTouch header file ) , and I did a trick : I created a new Group (CorePlotGroup) and select all headers from CorePlotHeaders directory and Drag and Drop them in CorePlotGroup. This will "remove" the error.I removed reference to CorePlotHeaders directory . Now it's working

0
votes

I got it working a few days ago, this is what I did:

  • I made a view-based project.
  • I copied the Core Plot Headers folder in my supporting files.
  • I copied the libCorePlot-CocoaTouch.a to the project and under the frameworks
  • Under the Build settings I changed the 'other linker flags' 'to -ObjC -all_load'
  • check that under the build phases the 'link binary with library' is showing the .a file.
  • #import "CorePlot-CocoaTouch.h" in the ViewController.h file

I hope this helps!

Gr

Dieter