Search code examples
iosobjective-cdealloc

Dealloc Not Called in ARC-Enabled Application


So I have just completed coding an application in xCode 5.1.1 running on a iOS 7 device (App is ARC Enabled). Everything is complete and no crashes are occurring but I want to make sure the application is problem free before submitting it for review.

I have put log statements in each of my view controllers DEALLOC methods to make sure they are being called..not one of them is being called, ever! Not sure if this is how it is supposed to be in an ARC-Enabled application? Also, it worries me because when I run the application and switch to the "Debug Navigator" tab the memory usage of the app continues to increase, as if view controllers are not being released after they are dismissed or a push/modal segue happens. Any help or thoughts would be greatly appreciated on the matter.

Thanks.


Solution

  • Looks like you are having strong references to view controllers that you are not aware of. Use the static analyser to warn you about any reference cycles. In general, look at warnings and fix them. You may have things stuck in an NSArray unexpectedly. Check all variables holding these view controllers, are there any stored in objects, that you might have to change to nil?