现在的位置: 首页 > 综合 > 正文

Core Plot SDK的用法

2013年01月11日 ⁄ 综合 ⁄ 共 772字 ⁄ 字号 评论关闭

接前一篇博文《开源框架Core Plot的使用》。

如果使用了Core Plot标准Mac安装包进行安装,使用起来有一些变化。其实,如果你注意到安装器的最后一个界面,这里已经有一个如何使用的介绍了:

To add the Core Plot SDKs to an iOS Project:

 

1. Add to your project's .PCH file:

 

#import <CorePlot/CorePlot.h>

 

3. Open Project -> Edit Project Settings and for All Configurations :

 

3a. Add to Additional SDKS :

(System)

/Library/SDKs/CorePlotSDK/${PLATFORM_NAME}.sdk

 

(User)

${HOME}/Library/SDKs/CorePlotSDK/${PLATFORM_NAME}.sdk

 

3b. Add to Other Linker Flags :

 

-ObjC -all_load -lCorePlot

 

4. Add the QuartzCore framework to the project.

 

5. Add a CPGraph to your application.

 

但即使你step by step,也未必能编译通过一个Core Plot应用项目。

这是因为项目Build Info中,C/C++ Compiler Version必须使用LLVM GCC 4.2,而不能使用GCC 4.2。

另外,如果你在源文件中 #import "CorePlot-CocoaTouch.h" ,将导致一个错误。

因为SDK的头文件是CorePlot.h,而不是CorePlot-CocoaTouch.h。但我们已经在.PCH文件中import过CorePlot.h了,并不需要在源文件中显示地import。

抱歉!评论已关闭.