0
  1. I am using ARC.
  2. The case of study here inculdes a custom UITabBarController and one of its UIViewControllers.
  3. The Tabbar have a strong reference to an Object of some class. That object also have a strong reference to the Tabbar itself which caused a loop that caused the dealloc not to be called.
  4. Same thing with the ViewController it has a strong reference to an Object and the object back to the viewcontroller. Its not getting deallocated too. but that happen because its parent uitabbarcontroller is not deallocated. When I remove strong reference from the tabbar to the object both gets deallocated while logically only the tabbar should be allocated since the viewcontroller still have the strong loop reference.

Any idea what is happenning here. I investigated this for like 2 hours with no results.

Why the viewcontroller and the uitabbarcontroller is not behaving the same way?

hasan
  • 23,815
  • 10
  • 63
  • 101
  • Something else is retaining it? Show some code. Use instruments. – Wain Sep 18 '16 at 22:58
  • nothing at all. when I remove that reference from the object to the uitabbarcontroller it get deallocated. – hasan Sep 18 '16 at 22:59
  • I also open another instance of the view controller from the same view controller. and that new instance didnot get deallocated. What I concluded that a child view controller of a uitabbarcontroller work deferently in the matter of deallocation. its like the uitabbar controller forces the deallocation of its childs if it get deallocated. I will update my question for a correction. – hasan Sep 18 '16 at 23:30
  • Your description is contradictory or confusing. Please fix it. – Avi Sep 19 '16 at 04:26
  • @Avi what about now? can you plase read it again. – hasan Sep 19 '16 at 10:20

0 Answers0