升级到xcode 7.3后的CorePlot错误

时间:2016-03-30 19:00:48

标签: ios xcode core-plot

我今天将xcode更新到版本7.3,突然使用CorePlot的模块抛出了错误。 “图表不可用”和“dataSource不可用”。我从一开始就没有对这部分代码进行更改。我注意到有一个新版本的CorePlot - 会有帮助还是有害? 代码段:

//1a - set up the 2 scatter plots - avg expected return for each portfolio
CPTScatterPlot *modelAvgRtnPlot = [[CPTScatterPlot alloc] init];
modelAvgRtnPlot.dataSource = self;
modelAvgRtnPlot.identifier = @"Portfolio A Expected Avg Return";
modelAvgRtnPlot.title = @"Model (A) Average Rtn";

modelAvgRtnPlot.dataSource = self;行给出编译错误'dataSource in unavailable'

第二期“图表”问题 - 片段:

-(void)barPlot:(CPTBarPlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)index {
// 1 - Is the plot hidden?
if (plot.isHidden == YES) {
    return;
}
// 2 - Create style, if necessary
static CPTMutableTextStyle *style = nil;
if (!style) {
    style = [CPTMutableTextStyle textStyle];
    style.color= [CPTColor darkGrayColor];
    style.fontSize = 16.0f;
    style.fontName = @"Raleway-Bold";
}
// 3 - Create annotation, if necessary
NSNumber *price = [self numberForPlot:plot      field:CPTBarPlotFieldBarTip recordIndex:index];
if (self.priceDeviationAnnotation) {
    [plot.graph.plotAreaFrame.plotArea removeAnnotation:self.priceDeviationAnnotation];
    self.priceDeviationAnnotation = nil;
}

在上面,[plot.graph.plotAreaFrame.plotArea...]给出错误“'图表'不可用”

2 个答案:

答案 0 :(得分:2)

以下是另一种解决方案:

我已修复此问题,Xcode - BuildSetting - 手动保留释放中的弱参考 并已解决。

答案 1 :(得分:1)

您是否在未启用ARC的情况下编译项目?最近在this github issue中讨论了在没有使用Xcode 7.3的情况下编译的项目。它已使用this commit在主分支中修复。

如果您目前无法升级到master,则从提供问题的属性定义中删除cpt_weak应修复编译错误。

相关问题