【发布时间】:2013-07-28 20:58:19
【问题描述】:
我有一个饼图使用核心绘图的数据源和委托方法工作,但是我现在尝试使用绑定并遇到一些问题。
我使用以下代码绑定到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 正在返回正确的值,所以我不知道我做错了什么......有什么建议吗?
【问题讨论】:
标签: cocoa core-plot cocoa-bindings