【问题标题】:Cocoa Bindings & Core Plot可可绑定和核心情节
【发布时间】: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


    【解决方案1】:

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

    【讨论】:

    • 我之前使用的是二进制文件,所以不得不更改为 Dependent 方法...花了一些时间来设置,但现在一切正常,谢谢。
    猜你喜欢
    • 2023-03-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-12-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多