【发布时间】:2012-07-06 06:54:07
【问题描述】:
我正在开发一个 iOS 应用程序,我正在使用核心绘图来绘制图形。 一次需要绘制 15-16 个图表。 我有一个同步按钮,它从服务器获取数据并相应地绘制图表。 每次同步时,图表的数量可能会有所不同。 在绘制每个图表之前,我将使用代码发布早期的对象:
[smartbarChartView.hostedGraph.axisSet removeFromSuperlayer];
smartbarChartView.hostedGraph.axisSet=nil;
smartbarChartView.hostedGraph=nil;
smartbarChartView = nil;
当我同步 2-3 次时,我仍然收到错误 CoreAnimation: failed to allocate xxxx bytes and application 卡住。
尝试解决问题一整天。
非常感谢任何指导。
提前致谢!
【问题讨论】:
-
您在使用 ARC 吗?如果没有,您问题中的代码不会发布任何内容。
-
是的。我正在使用 ARC 和 AFAIK 将对象设置为 nil 应该可以释放它们。对吧?
标签: ios memory-management core-animation core-plot