开发者

Can't update CPXYPlotSpace in Core-Plot all the times

I'm using Core-Plot for an iPhone application. I'm trying to update the CPXYPlotSpace when the number of records is changed by the user. plotSpace is defined in the header. When the view loads, I setup the chart. When the user change the range of the data it works soem times. It works the first 开发者_C百科3 or 4 times that the range is changed, after that I got a pointer being freed was not allocated

This is the code I'm using to update the CPXYPlotSpace:

if(plotSpace)
        [plotSpace release];

    plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace;

    plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(0)
                                                   length:CPDecimalFromFloat(recordsLimit)];


    plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(-25)
                                                   length:CPDecimalFromFloat(100)];

Looks like a tread issue?


Don't release the plot space. It is owned by the graph.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜