gpt4 book ai didi

ios - 在带有 Xcode 8 的 Objective C 中使用图表(BarChartDataEntry)iOS 库

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:34:18 24 4
gpt4 key购买 nike

我在我的 objective-C 项目中安装了图表库(3.0.1 版)( https://github.com/danielgindi/Charts )。在我以前版本的代码中,下面的行成功运行,

    BarChartDataSet *set12 = [[BarChartDataSet alloc] initWithYVals:yvals label:@"Water Consumed"];

在最新版本的图表中,即 3.0.1,以上行导致构建错误:-

No visible @interface for 'BarChartDataEntry' declares the selector 'initWithValue:xIndex:'

我有 BarChartDataSet 类,但没有这样的方法。在 Objective-C 中,这个方法的替代品是什么?

最佳答案

您需要对 BarChartDataSet 使用以下方法

BarChartDataSet *set1 = [[BarChartDataSet alloc] initWithValues:yVals label:@"Quarter Share"];

只需将 initWithYVals 替换为 initWithValues

关于ios - 在带有 Xcode 8 的 Objective C 中使用图表(BarChartDataEntry)iOS 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41805375/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com