按日期平均 NSArray 中的 NSDictionaries
我正在尝试输出到图表。
我有一个 NSDictionaries 数组。每个字典都有一个 NSDate (objectForKey:@"date"
) 和一个值 (objectForKey:@"value"
)。
我想要做的是平均每天的所有结果,然后按日期排序,添加缺失的天数(结果全部来自过去 7 天)。
有没有简单的方法可以做到这一点?
谢谢
I'm trying to output to a graph.
I have an array of NSDictionaries. Each of these dictionaries have an NSDate (objectForKey:@"date"
) and a value (objectForKey:@"value"
).
What I want to do is average all the results per day and then order it by date, putting in missing days (the results are all from the last 7 days).
Is there any easy way to do this at all?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
没有测试过,但是类似的东西?
Not tested, but something like this?