i'm facing a memory problem with my app,
I have a nav based app, if i push, pop and push all of my controllers the app will close due to memory overload.
I think it is what we call a retain cycle :
I have a custom nav controller : MyNavController
, this Controller is my root controller, and push the main UIViewController
: MyMainController
, when the app starts the app use about 130 MB of memory, when i push a new controller : the memory goes up to 160 then i pop this controller : the memory is still 160 (159 exactly) then i push another view controller : the memory goes up to 190 MB ... The memory never goes down.
Can you confirm me that is a retain cycle ?
If i'm not wrong when i pop a view controller the memory should decrease of the view controller memory size ?
I always use strong into my properties (button, view, customView, customObject...) but when i set a breakpoint into my second level controller into the dealloc method i know that it is called, so the controller should be released ?
I have try something : i made an empty
UIViewController
and set the view in my xib to one of my non released controller so it could be more heavy than clear, so this controller have no line of code, simply a .h and .m with no custom code nothing, when i push this controller the memory goes up and when i pop it the memory does not go down ! I really do not understand what i have to look for, do i have to llok for on myMainViewController
? or in the controller i push on the stack ?
I simply load my controller using :
GeoControllerViewController *aGeoController = [[GeoControllerViewController alloc] initWithNibName:@"GeoControllerViewController" bundle:nil];
aGeoController.dictionnaryModele = _dicCours;
[self.navigationController pushViewController:aGeoController animated:YES];
Thanks in advance.