0

I have a view controller that is not being released even though to the best of my knowledge I am setting all delegates to nil, removing all gestures, etc. but even with Instruments I am struggling to understand what is retaining the view controller. I have the "Record Retain Count" option enabled.

The name of my UIViewController in question is TDTPaintingViewController and is being loaded and unloaded by TDTOilistOptionsViewController.

Its not clear to me what owns the retain counts, and I am confused why it shows things more than once even though if I step through my code its only called once (e.g. TDTOilistOptionsViewController.loadPaintingView()).

Attached is the Instruments trace. I would greatly appreciate it if someone might help interpret it. Not only would it help with this issue, it would help me understand how to use the tool in the future.

Allocations Instruments.trace

Jeshua Lacock
  • 5,730
  • 1
  • 28
  • 58

1 Answers1

0

Using Instrument Leak Template is a better way to track retain cycle and unreleased objects.

According to your trace file,block addChildViewController is a good start point ,especially this one:
enter image description here

wj2061
  • 6,778
  • 3
  • 36
  • 62
  • Thanks - I took a look at Leak and can't really tell the difference. What calls addChildViewController? I am using UINavigationController' pushViewController method to present the painting view controller. When I double click on the line you recommend it takes me to assembly code. – Jeshua Lacock May 11 '16 at 01:38
  • I found it - I thought I was removing the view controllers view and setting it to nil but I wasn't! – Jeshua Lacock May 11 '16 at 02:02