Hi my project is ARC based, I am using UINavigationController make transition between ViewController. I am using profiler to analyse what happening behind the scene with memory. I noticed that when i push a ViewController it allocate memory to all its components and when i pop it its not freeing the allocated memory.
Since i am using ARC i am unable to implement dealloc or release any component. I have analysed in detail and there is no memory leak in my project.
I am not using any strong property to push viewController. Here is how i am pushing ViewController.
viewController *obj = [[viewController alloc] init];
[self.navigationController pushViewController:obj animated:NO];
Any clue whats going on? what should i do to free up the memory that i have consumed. Please advise
deallocmethod with ARC. You just can't call[super dealloc]. You should usedeallocis you need to clean up any resources. Most likely you have a retain cycle in your code. Run the analyzer on your code. - rmaddydeallocmethod. ARC will take care of releasing objects. But it won't release things stuck in a retain cycle. - rmaddyviewWillDisappear:when using ARC? I've never useddeallocwhen using ARC, and my approach has always been removing observers that aren't needed when the view isn't on screen. Hence,viewWillDisappear:. - swiftcodeview(Will|Did)Disappearbeing called on vc A. I still want vc A to get any important notifications set it is updated properly by the time vc B is dismissed. But it depends on your needed. Here's a good rule of thumb - keep things balanced. If you add something inviewWillAppearthen remove it inviewDidDisappear. If you add something ininit, remove it indealloc. You get the idea. - rmaddy