Search code examples
iosautomatic-ref-countingdealloc

Dealloc called after popViewControllerAnimated without calling viewDidUnload


Project with ARC. Dealloc method is called immediately after the call popViewControllerAnimated viewDidUnload method with no cause. Because of this, I have many different about this type of crash


Crash 1

Crash 2

Crash 3

Crash 4

and many other similar.

Here is the call stack method dealloc

dealloc call stack

Have any idea?


Solution

  • Why do you think that viewDidUnload will be called?

    As mentioned in Are viewDidUnload and dealloc always called when tearing down a UIViewController? , When is UIViewController viewDidUnload called? , viewdidunload is not getting called at all , and many other articles, it is perfectly normal for viewDidUnload not to be called.

    Why should that cause a crash? You must be doing something wrong.