gpt4 book ai didi

cocoa - 构建期间与 Core Plot 链接时出错

转载 作者:行者123 更新时间:2023-12-03 16:18:20 25 4
gpt4 key购买 nike

我刚刚根据教程 ( http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application ) 将核心图 View 添加到我的应用程序中。我已将 Core Plot 绘图代码放入包含 CPLayerHostingView 的窗口的窗口 Controller 的 windowDidLoad 方法中。该图的代码是:

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”,引用自: HistogramWindowController.o 中的文字指针@__OBJC@__cls_refs@CPPlotRange

“_CPDecimalFromFloat”,引用自: -HistogramWindowController.o 中的[HistogramWindowController windowDidLoad] -HistogramWindowController.o 中的[HistogramWindowController windowDidLoad] -HistogramWindowController.o 中的[HistogramWindowController windowDidLoad] -HistogramWindowController.o 中的[HistogramWindowController windowDidLoad]

“.objc_class_name_CPLineStyle”,引用自: HistogramWindowController.o 中的文字指针@__OBJC@__cls_refs@CPLineStyle

“.objc_class_name_CPXYGraph”,引用自: HistogramWindowController.o 中的文字指针@__OBJC@__cls_refs@CPXYGraph

“.objc_class_name_CPscatterPlot”,引用自: HistogramWindowController.o 中的文字指针@__OBJC@__cls_refs@CPscatterPlot

“.objc_class_name_CPPlotSymbol”,引用自: HistogramWindowController.o 中的文字指针@__OBJC@__cls_refs@CPPlotSymbol

“.objc_class_name_CPColor”,引用自: HistogramWindowController.o 中的文字指针@__OBJC@__cls_refs@CPColor

“.objc_class_name_CPFill”,引用自: HistogramWindowController.o 中的文字指针@__OBJC@__cls_refs@CPFill

ld:未找到符号collect2:ld返回1退出状态

我从来没有遇到过这样的错误。任何人都可以阐明问题可能是什么吗?

干杯

最佳答案

这意味着你没有正确链接到框架中。您可能刚刚将框架添加到项目中,#import编辑了 header ,但忘记确保框架实际上已链接到您的目标。

关于cocoa - 构建期间与 Core Plot 链接时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1377230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com