我已經下載Core-Plot Header 9.0
並添加到我的新項目中。我非常新的繪製圖形和使用Core-Plot框架。我已經從core-plot示例項目下載了示例項目CPTTestApp-iPhone
。我打開這個項目它包含CorePlot-Cocoa Touch.xcodeproj
如果我試圖從XCode4.2運行這個項目自動XCode3.2.4應用程序打開。我剛從CPTTestAppScatterPlotController.h
複製源代碼並粘貼到我的新項目中。 CPTTestAppScatterPlotController.h
有一個筆尖文件,但我沒有任何筆尖文件,也是我想要以編程方式。所以,我只是改變了從CPTTestAppScatterPlotController.h
這些線在我的項目如下代碼喜好,如何在iPhone中使用CorePlot框架繪製lineGraph?
graph = [[CPTXYGraph alloc] initWithFrame:CGRectZero];
CPTTheme *theme = [CPTTheme themeNamed:kCPTDarkGradientTheme];
[graph applyTheme:theme];
CPTGraphHostingView *hostingView = [[CPTGraphHostingView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
hostingView.hostedGraph = graph;
hostingView.collapsesLayers = NO;
//hostingView.collapsesLayers = YES; // Setting to YES reduces GPU memory usage, but can slow drawing/scrolling
[self.view addSubview:hostingView];
但是,所有的功能我沒有從CPTTestAppScatterPlotController.h
改變。仍然項目沒有運行,它顯示Build Succeeded
。我的疑問是我需要在我的新項目中導入CorePlot-Cocoa Touch.xcodeproj
?以及我如何運行我的項目?請幫助我運行我的項目。我在谷歌搜索了很多,所有建議這個項目爲初學者CPTTestApp-iPhone
。我也只嘗試這個項目。提前致謝。等待你的偉大的解決方案。這是我運行項目*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSDecimalNumber cgFloatValue]: unrecognized selector sent to instance
時發生的錯誤。