Closed GoogleCodeExporter closed 8 years ago
I suspect you're running out of memory. Does your app get a memory warning
before graphs disappear? If this is the problem, you'll need to release (remove
any strong references) the graphs that are offscreen to free up memory.
Original comment by eskr...@mac.com
on 7 Sep 2013 at 8:03
I've made a test and no, I'm not getting any memory warning
(didReceiveMemoryWarning) before the graphs disappears.
I've used also the Allocation instrument but the trend doesn't grow up during
the iterations.
The strange thing is also:
If I run the app in this way:
view1 --> view2 --> view3 --> view4 --> view5 --> view6 --> view7
the graphs doesn't disappear (after 200 iterations).
If I run the app in this way:
view1 --> view2 --> view3 --> view4 --> view5 --> view6 --> view7 --> view8
the graphs disappear after 49 iterations
If I run the app in this way:
view1 --> view2 --> view3 --> view4 --> view5 --> view6 --> view7 --> view8 -->
last view
the graphs disappear after 7 iterations.
Is also interesting to know that:
view3 and view6, view4 and view7, view5 and view8 are specular (they are two
classes presenting the same graphs with only different variables)
This is the way I've created the dealloc method (since I'm using ARC), are
there any issues?
-(void)dealloc
{
touchPlotBall = nil; //(CPTScatterPlot)
dataSourceLinePlot= nil; //(CPTScatterPlot)
dataSourceSLinePlot = nil; //(CPTScatterPlot)
[scatterPlotViewValue removeFromSuperview]; //(CPTGraphHostingView)
scatterPlotViewValue=nil; //(CPTGraphHostingView)
[scatterPlotViewBall removeFromSuperview]; //(CPTGraphHostingView)
scatterPlotViewBall=nil; //(CPTGraphHostingView)
[self.dataForPlot removeAllObjects]; //(NSMutableArray)
self.dataForPlot = nil; //(NSMutableArray)
[self.dataForPlot1 removeAllObjects]; //(NSMutableArray)
self.dataForPlot1 = nil; //(NSMutableArray)
[contentArray removeAllObjects]; //(NSMutableArray)
contentArray = nil; //(NSMutableArray)
[contentArray1 removeAllObjects]; //(NSMutableArray)
contentArray1 = nil; //(NSMutableArray)
[generalStockData removeAllObjects]; //(NSMutableArray)
generalStockData = nil; //(NSMutableArray)
[periodStockData removeAllObjects]; //(NSMutableArray)
periodStockData = nil; //(NSMutableArray)
[shortPeriodStockData removeAllObjects]; //(NSMutableArray)
shortPeriodStockData = nil; //(NSMutableArray)
self.startGraphValue=nil; //(NSDate)
self.delegate = nil; //(id<view7ControllerDelegate> delegate;)
self.fetchedResultsController = nil;
self.managedObjectContext = nil;
ballImage =nil;
}
Original comment by vasco.al...@gmail.com
on 8 Sep 2013 at 8:04
Typically, things that appear in dealloc under ARC are:
1.Properties whose data type is not an ObjectC object, like CGColor.
2.Any to-be-unregistered Observers. (from methods that begins with addObserver:)
ARC takes care much of the rest. Writing self.nameofProperty=nil for an
NSMutablbeArray,
which is an ObjectC object in dealloc, suggest you do not understand ARC.
Please consider slowing down and re-evaluate your memory management-fu.
Also, given your description without seeing your project source, it is not
possible to even know
if this is a bug. Consider reducing the complexity of your project to be sure
this is indeed a bug,
reproducible even in simple cases.
Original comment by ytrfa...@gmail.com
on 8 Sep 2013 at 8:52
I'll do this changes and let you know. Actually you're right for the
deallocation of NSMutableArray on ARC.
But form you I needed to understand if something from CorePlot should be setted
to nil or not during the deallocation. I have no strong references to any
CorePlot object.
For the rest I'll do a test and let you know.
Original comment by vasco.al...@gmail.com
on 8 Sep 2013 at 9:04
Original comment by eskr...@mac.com
on 11 Oct 2013 at 12:28
Actually the problem was on my project.
Thanks for the support.
Original comment by vasco.al...@gmail.com
on 11 Oct 2013 at 6:12
Original issue reported on code.google.com by
vasco.al...@gmail.com
on 7 Sep 2013 at 4:27