CorePlot SDK的安装以及应用

一周了,总算是把曲线图和柱状图整出来了。记笔记,防忘记。

CorePlot SDK的安装:参照http://zani.iteye.com/blog/1135883

试用第一种方法安装,我下载的是CorePlot_1.0.zip。只要照着第一种方法做没问题。

一 第一种安装方法:

1.从http://code.google.com/p/core-plot/downloads/list下载CorePlotInstaller_xxx.zip, 下载后解压并安装,  会将SDK默认安装在/Library/SDKs/CorePlotSDK/目录下.

2. 安装后, 在/Library/SDKs/CorePlotSDK/下有两个文件夹iphoneos.sdk和iphonesimulator.sdk, 可见一个是用于真机, 另外一个是用于模拟器. 现在我们用lipo命令将两个静态库合并: 

 打开命令行 Terminal.app 输入:

 lipo -create

  然后依次把两个.a文件拖到终端窗口, 命令行会变成这样:

 lipo -create /Library/SDKs/CorePlotSDK/iphoneos.sdk/usr/lib/libCorePlot.a    /Library/SDKs/CorePlotSDK/iphonesimulator.sdk/usr/lib/libCorePlot.a

然后接着输入 -output 目标文件路径,如:

-output /Users/keesuper/Test/Core_Plot_Test/coreplot/lib/libCorePlotAll.a

最后现在这样一条命令:

lipo -create /Library/SDKs/CorePlotSDK/iphoneos.sdk/usr/lib/libCorePlot.a  /Library/SDKs/CorePlotSDK/iphonesimulator.sdk/usr/lib/libCorePlot.a -output /Users/keesuper/Test/Core_Plot_Test/coreplot/lib/libCorePlotAll.a

好了,回车,这样就会生成通用的静态库.

3. 将

/Library/SDKs/CorePlotSDK/iphoneos.sdk/usr/下的include目录复制到/Users/keesuper/Test/Core_Plot_Test/coreplot/目录下.

 4. Xcode->Project->Edit Project Settings,打开你的工程配置,点击Bulids标签, 将Configuration设置成All Configuration, 在: Header Search Paths里添加"./coreplot/include"; Library Search  Paths里添加"./coreplot/lib". 在other link flags里添加"-ObjC -all_load -lCorePlotAll"

二 第二种安装方法:

1. 下载并安装Mercurial(很简单,在http://www.selenic.com/mercurial/wiki/ 有标准Mac安装包下载),再使用命令:

 hg clone http://core-plot.googlecode.com/hg/ core-plot

即可把Core Plot项目源代码下载到指定目录core-plot下。

 2. 将下载好了的源码复制到工程目录下, 

   Add->Existing Files…,把CorePlot-CocoaTouch.xcodeproj添加到新项目中

 3. 选择Target “get info->General”,添加对项目CorePlot-CocoaTouch的依赖(引用),(点击Linked Library上的"+"号).

 4.选择新项目的“get info->Build”,在“User Header Search Paths”中添加Core Plot头文件搜索路径,如:/Users/kmyhy/core-plot/framework。注意要选中“Recursive”小勾.

 

 

CorePlot 的使用。参照  http://wangpengfei360.iteye.com/blog/1425073

和 http://unmi.cc/ios-coreplot-chart-started  ,只不过把这里面的所有的CPT***的类,都变成CP***类就行了。

posted @ 2012-03-18 23:14  松花江以南  阅读(1641)  评论(0编辑  收藏  举报