Why ARC is not deallocating memory after popViewController Why ARC is not deallocating memory after popViewController ios ios

Why ARC is not deallocating memory after popViewController


When you dismiss a view controller (or pop it), it will be deallocated if you didn't make any strong pointers to it (that controller is retained by the navigation controller, or the presenting view controller, so you usually don't need to have a pointer to it when you create it and push or present it).

It will be be released if there are no other strong pointers to it


Consider reviewing whether you are referencing self in a block. If you do, you risk holding onto the UIViewController reference after you have popped it.

For a more in-depth review of why, check out this answer:How do I avoid capturing self in blocks when implementing an API?