2

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?

glebus
  • 197
  • 1
  • 1
  • 11
  • What exactly is the question here? You don't expect a dealloc? Is your view controller being retained by anything else than navigation controller? – Dmitry Shevchenko Sep 15 '12 at 05:47
  • possible duplicate of [Are viewDidUnload and dealloc always called when tearing down a UIViewController?](http://stackoverflow.com/questions/1768076/are-viewdidunload-and-dealloc-always-called-when-tearing-down-a-uiviewcontroller) – newacct Sep 16 '12 at 05:28
  • @DmitryShevchenko The issue is that I do not understand how you can be called dealloc without viewDidUnload and whether crashes be associated with this behavior. – glebus Sep 17 '12 at 07:58
  • @glebus, do you use iOS6 sdk by any chance? – Dmitry Shevchenko Sep 17 '12 at 15:28
  • glebus, despite what the method name is called, viewDidUnload (if I understand it correctly, correct me if I am wrong) is only called when your app runs into low memory situation, that's when the app start calling viewDidUnload. ViewDidUnload doesn't get called when you pop a view controller but viewWillDisappear or viewDidDisappear does get called. I was confused at first too. – Zhang Sep 18 '12 at 02:05
  • Dmitry, I am seeing a problem with SDK 6.0 in creating two instances of a viewController and immediately releasing one (hitting the dealloc method), the stack on the break does not come from my code, it's bizarre... from your comment I wonder if you have seen the same? Jim – JimP Nov 14 '12 at 18:17

1 Answers1

1

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.

Community
  • 1
  • 1
user102008
  • 30,736
  • 10
  • 83
  • 104