2012-04-26 113 views
0

我正在尝试使用链接实现绘图。在iPhone中使用核心图实现绘图图形

http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application

至于支持我需要添加绘图文件&框架。

How to install CorePlot framework correctly?

I am using xcode 4.1

复制CorePlotHeaders到我的Xcode项目

复制libCorePlotCocoaTouch.a到我的Xcode项目

添加到其它链接器标记在我的目标建立设置-ObjC -all_load

xcode 4.1

And please provide me any other best tutorials for Graph applications in xcode4.1

我有一个错误导致崩溃的应用程序

终止应用程序由于未捕获的异常 'NSInvalidArgumentException' ,原因:' - [NSCFString sizeWithTextStyle:]:无法识别的选择[R在第一掷发送到实例0x4e88e20'

调用堆栈: ( 0的CoreFoundation 0x012865a9 __exceptionPreprocess + 185

1 libobjc.A.dylib      0x000b4313 objc_exception_throw + 44 
2 CoreFoundation      0x012880bb -[NSObject(NSObject) 

doesNotRecognizeSelector:] + 187

3 CoreFoundation      0x011f7966 ___forwarding___ + 966 
4 CoreFoundation      0x011f7522 _CF_forwarding_prep_0 + 50 
5 ESPT        0x00031b60 -[CPTTextLayer sizeThatFits] + 125 
6 ESPT        0x00031cab -[CPTTextLayer sizeToFit] + 62 
7 ESPT        0x000316bf -[CPTTextLayer initWithText:style:] + 188 
8 ESPT        0x0002bf69 -[CPTAxis 
+0

的可能重复[错误: “ - \ [NSCFString sizeWithTextStyle:\]:无法识别的选择”,在IPhone SDK(http://stackoverflow.com/questions/5040067/error-nscfstring-sizewithtextstyle-unrecognized-selector-in-iphone-sdk) – 2012-04-26 14:37:50

+0

请按照下面的链接。它包含如何在我们的项目中安装核心图库,并解释如何绘制散点图。希望你按照这个方法找到解决方案。 http://www.johnwordsworth.com/2011/10/adding-charts-to-your-iphone-ipad-app-using-core-plot/ – Manikandan 2012-04-26 11:37:00

+0

是的,这是xcode 4的好教程 – Ranga 2012-04-26 12:25:01

回答

2

转到您的项目构建设置 - >链接选项

在这里看到:

enter image description here

+0

我没有其他linkeflag 。好吧,我有其他LD国旗...如何在那里添加-ObjC -all_load?看到我的编辑问题带有错误 – Ranga 2012-04-26 11:01:44

+0

@Ranga只需点击** Debug **和** Release **子字段,编辑就是了! :-) – 2012-04-26 11:03:36

+0

@Ranga我的例子是Xcode 4 ...对不起... – 2012-04-26 11:04:20