Cocoa Bindings&核心情节

时间:2013-07-28 20:58:20

标签: cocoa core-plot cocoa-bindings

我有一个饼图使用数据源和委托方法进行核心绘图,但是我现在正在尝试使用绑定并遇到一些问题。

我使用以下代码绑定到arraycontroller:

[graph addPlot:pieChart];

    // add bindings
    NSLog(@"The arranged objects are: %@", [[[self sectorAllocation] arrangedObjects] valueForKey:@"sectorPercentage"]);
    [pieChart bind:CPTPieChartBindingPieSliceWidthValues toObject:[self
                                                    sectorAllocation] withKeyPath:@"arrangedObjects.sectorPercentage"
           options:nil];

    //Set the sorting
    [[self sectorAllocation] setSortDescriptors:[NSArray arrayWithObject:
                                         [NSSortDescriptor sortDescriptorWithKey:@"sectorPercentage" ascending:YES]]];

似乎挂起了updateNormalizedData函数。基于我的NSlog语句,我的arraycontroller返回正确的值,所以我不知道我做错了什么...有什么建议吗?

enter image description here

1 个答案:

答案 0 :(得分:2)

您在饼图中发现了一个错误。我刚修好它并将更改推送到存储库。使用Mercurial提取最新代码。如果您不想更新整个Core Plot库,请使用更改here修补您的副本。