チュートリアル ( http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application )に基づいて、Core Plot ビューをアプリケーションに追加しました。CPLayerHostingView を含めたウィンドウのウィンドウ コントローラーの windowDidLoad メソッドに Core Plot 描画コードを配置しました。プロットのコードは次のとおりです。
CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace;
plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(-6)
length:CPDecimalFromFloat(12)];
plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(-5)
length:CPDecimalFromFloat(30)];
CPXYAxisSet *axisSet = (CPXYAxisSet *)graph.axisSet;
CPLineStyle *lineStyle = [CPLineStyle lineStyle];
lineStyle.lineColor = [CPColor blackColor];
lineStyle.lineWidth = 2.0f;
axisSet.xAxis.majorIntervalLength = [[NSDecimalNumber decimalNumberWithString:@"5"] decimalValue];
axisSet.xAxis.minorTicksPerInterval = 4;
axisSet.xAxis.minorTicksPerInterval = 4;
axisSet.xAxis.majorTickLineStyle = lineStyle;
axisSet.xAxis.minorTickLineStyle = lineStyle;
axisSet.xAxis.axisLineStyle = lineStyle;
axisSet.xAxis.minorTickLength = 5.0f;
axisSet.xAxis.majorTickLength = 7.0f;
axisSet.xAxis.axisLabelOffset = 3.0f;
axisSet.yAxis.majorIntervalLength = [[NSDecimalNumber decimalNumberWithString:@"5"] decimalValue];
axisSet.yAxis.minorTicksPerInterval = 4;
axisSet.yAxis.minorTicksPerInterval = 4;
axisSet.yAxis.majorTickLineStyle = lineStyle;
axisSet.yAxis.minorTickLineStyle = lineStyle;
axisSet.yAxis.axisLineStyle = lineStyle;
axisSet.yAxis.minorTickLength = 5.0f;
axisSet.yAxis.majorTickLength = 7.0f;
axisSet.yAxis.axisLabelOffset = 3.0f;
CPScatterPlot *xSquaredPlot = [[[CPScatterPlot alloc]
initWithFrame:graph.defaultPlotSpace.bounds] autorelease];
xSquaredPlot.identifier = @"X Squared Plot";
xSquaredPlot.dataLineStyle.lineWidth = 1.0f;
xSquaredPlot.dataLineStyle.lineColor = [CPColor redColor];
xSquaredPlot.dataSource = self;
[graph addPlot:xSquaredPlot];
ビルドすると、次のエラーが発生します。
「.objc_class_name_CPPlotRange」、参照元:literal-pointer@__OBJC@__cls_refs@CPPlotRange in HistogramWindowController.o
「_CPDecimalFromFloat」、以下から参照: -[HistogramWindowController windowDidLoad] (HistogramWindowController.o) -[HistogramWindowController windowDidLoad] (HistogramWindowController.o) -[HistogramWindowController windowDidLoad] (HistogramWindowController.o) -[HistogramWindowController windowDidLoad] (HistogramWindowController.o)
「.objc_class_name_CPLineStyle」、参照元:literal-pointer@__OBJC@__cls_refs@CPLineStyle in HistogramWindowController.o
".objc_class_name_CPXYGraph"、参照元:literal-pointer@__OBJC@__cls_refs@CPXYGraph in HistogramWindowController.o
「.objc_class_name_CPScatterPlot」、参照元:literal-pointer@__OBJC@__cls_refs@CPScatterPlot in HistogramWindowController.o
「.objc_class_name_CPPlotSymbol」、参照先:literal-pointer@__OBJC@__cls_refs@CPPlotSymbol in HistogramWindowController.o
「.objc_class_name_CPColor」、参照先: HistogramWindowController.o のliteral-pointer@__OBJC@__cls_refs@CPColor
「.objc_class_name_CPFill」、参照先: HistogramWindowController.o のliteral-pointer@__OBJC@__cls_refs@CPFill
ld: シンボルが見つかりません collect2: ld は 1 つの終了ステータスを返しました
このようなエラーに遭遇したことはありません。問題が何であるかについて誰かが光を当てることができますか?
乾杯