Search code examples
iosxcode4ios5core-plot

How do I use the Core-Plot framework for iOS in Xcode 4.2?


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!


Solution

  • 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