I've recently converted my iOS project over to ARC. One of the view controllers is not calling its dealloc method and is not being dealloc'ed according to Instruments.
I've double checked all of my properties and set the appropriate ones to weak. I've also made sure that anything that has the view controller as a delegate has it unset on viewWillDisappear but the view still sticks around in memory.
I'm a newbie at Instruments: how can I tell what is retaining this view?
If you are using Xcode 8 or above, you can use the memory graph thingy to see what object holds a reference to what object. Now you can clearly see that it is retained by a closure! That is how you use the memory graph to see where you should put weak-references and avoid retain cycles.
You can access the instruments by using Product ➔ Profile from the Xcode menu for which the shortcut handle is ⌘ + I . This will rebuild your product and opens the Xcode Instruments overview.
Well if you are really stuck and the program is complex (or abstracted, in the case of ARC), you can bring out the cannons:
cmd+i
(Profile)cmd+shift+e
for Extended DetailIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With