我已经下载了Core-Plot Header 9.0并添加到我的新项目中。我很新画图表和使用Core-Plot框架。我已经从core-plot样本项目下载了样本项目CPTTestApp-iPhone。我打开这个项目,它包含CorePlot-Cocoa Touch.xcodeproj,如果我试图运行这个项目从XCode4.2自动XCode3.2.4应用程序打开。我只是从CPTTestAppScatterPlotController.h复制源代码并粘贴到我的新项目中。该CPTTestAppScatterPlotController.h有一个nib文件,但我没有任何nib文件,我也想通过编程来实现。因此,我在我的项目中更改了CPTTestAppScatterPlotController.h中的这些行,就像下面的代码一样,
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时出现的错误。
发布于 2011-12-26 13:53:17
感谢所有人。我已经解决了这个问题。我只是忘了在mu项目目标构建设置中添加-ObjC -all_load。Pelase遵循下面的步骤来避免我的问题,
1. Copy the CorePlotHeaders to your Xcode project
2. Copy libCorePlotCocoaTouch.a to your Xcode project
3. Add to Other Linker Flags in your target build settings:
-ObjC -all_load谢谢。
https://stackoverflow.com/questions/8633067
复制相似问题