Installing Core-Plot in Xcode 4.2 for iOS project

后端 未结 2 1210
南笙
南笙 2020-12-05 06:15

I am trying to install Core Plot into my iOS app. I have followed the instructions on the Core Plot website but they are very brief and have no screenshots. I have pasted th

相关标签:
2条回答
  • 2020-12-05 06:38

    The easiest way is to include the core-plot .h files and the library binary files (the .a file).

    You just drag them all into the project.

    Cheers.

    0 讨论(0)
  • 2020-12-05 06:53

    Seeing as how I wrote those instructions, I can take a stab at clarifying the part you're having trouble with.

    You'll need to set the header search path so that when you include CorePlot-CocoaTouch.h, Xcode knows where to pull that from. This is located within the Build Settings for your application project under the Header Search Paths build setting. It looks like the following:

    Header search paths

    Double-click on the field for the header search paths and bring up this popup:

    Header search paths popup

    The path you specify here is the relative path from your Xcode project file to the directory where you installed Core Plot. In my case, I had both my application project directory and Core Plot located within the same ~/Development directory, so the relative path involved stepping back a level (the ../) and going to the core-plot directory that I had cloned the framework into. You then need to point to the framework subdirectory, where the actual framework source is stored.

    Finally, checking the little box to the left of the path makes the header search recursive, so it will find headers contained in subdirectories of this one.

    As far as the linker flags go, find your Other Linker Flags within these same Build Settings and add -ObjC to the list of linker flags:

    ObjC linker flag

    This is needed so that symbols from the categories we use in the static library get pulled into your project properly. As I indicate, we used to need to add -all_load to this as well to work around a linker bug, but LLVM in Xcode 4.2 fixes this. That's good, because -all_load sometimes introduced duplicate symbols and broke building against certain third-party frameworks.

    Hopefully, this should clear up that particular section of the instructions. I tried to do my best to make those easy to follow and keep them up to date with the latest Xcode versions, but perhaps I wasn't detailed enough. If you got through all the rest of the steps fine, you should be good to go.

    0 讨论(0)
提交回复
热议问题