Installing Core-Plot in Xcode 4.2 for iOS project

[亡魂溺海] 提交于 2019-11-27 19:32:33

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:

Double-click on the field for the header search paths and bring up this 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:

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!