cocoa 绑定(bind)和核心情节

标签 cocoa core-plot cocoa-bindings

我有一个饼图,使用数据源和委托(delegate)方法来绘制核心图,但是我现在尝试使用绑定(bind)并遇到了一些问题。

我使用以下代码绑定(bind)到数组 Controller :

[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 语句,我的数组 Controller 返回正确的值,所以我不知道我做错了什么......有什么建议吗?

enter image description here

最佳答案

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

关于 cocoa 绑定(bind)和核心情节,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17912832/

相关文章:

cocoa - 通用 Cocoa 应用程序架构编程指南

core-plot - iPhone 4 iOS5 核心图和 ARC 错误 :"The current deployment target does not support weak references"

objective-c - 使用绑定(bind)时如何使子 NSManagedObjectContext 保持最新

cocoa - CoreData 和 cocoa 的数据绑定(bind)

macos - 如何将 NSObjectController 与 Core Data 结合使用?

objective-c - 替换 NSString 中的 [] 括号?

file - 在 cocoa 中保存文件

cocoa - NSView 高级概述?

ios4 - core-plot CPTextStyle fontName 只读

iphone - 如何在 Core Plot 中启用触摸交互?