Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
350 views
in Technique[技术] by (71.8m points)

ios - Using Core Plot 2 in an Xcode 5 project

I'm using the instructions here to integrate Core Plot into my iOS Xcode 5 project and am having no end of issues.

I tried using the Static Library Install but it seems this refers to 1.4 as there is no directory called CorePlotHeaders though if I try to use 1.4 I run into runtime issues.

I've then tried to drag the CorePlot-CocoaTouch.xcodeproj as described in the Dependent Project Install but this only copies it as if its a file and not the whole project.

Is there more current instructions for using it as a static library or how am I copying the project incorrectly into my project?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here are some current steps to follow to add the static Core Plot library to your project:

  1. download the latest version of CorePlot here

  2. navigate to the CorePlot framework folder and run CorePlot-CocoaTouch.xcodeproj

  3. build (not run) the CorePlot-CocoaTouch.xcodeproj project

  4. navigate back to your CorePlot download folder > build > Debug-iphoneos and verify libCorePlot-CocoaTouch.a has been created. If not, unzip the download and repeat steps 1-4

  5. back in Xcode highlight the CorePlot-CocoaTouch project

  6. click Product > Scheme > select Universal Library (selects which target to build)

  7. build project again (not run)

  8. go BACK to your CorePlot download folder > build > Release-universal and you will see the CorePlotHeaders folder and libCorePlot-CocoaTouch.a are both available

  9. open the Xcode project you would like to add static CorePlot to

  10. add the CorePlot > build > Release-universal > CorePlotHeaders folder and libCorePlot-CocoaTouch.a files to your project (selecting 'copy items into destination group's folder)

  11. select your Project and in the 'Linking' section find 'Other Linker Flags' and add -ObjC

  12. from your Target > Build Phases > Link Binary With Libraries add the QuartzCore framework to your project

  13. if libCorePlot-CocoaTouch.a is not in your Link Binary With Libraries list drag it from where you copied it to your project to the Library list to add it.

You should now be able to

#import "CorePlot-CocoaTouch.h" 

(autocomplete) to the viewController that you will be using to manage your CorePlot.

If you are following old documentation on how to use CorePlot be aware that the new prefix is CPT (not CP, adjust accordingly)

Happy coding!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...