Accessory Detail Button on Custom Table View Cell ⇒ Memory Leak

I have a demo project on GitHub that is demonstrating a memory leak in iOS 13.5 with Accessory Detail Buttons on Custom Table View Cells.

This is a very simple app that I’ve built just for demonstrating this problem—however you could easily recreate it yourself:

  1. Create Single View App XCode iOS Project
  2. Embed existing View Controller inside a Navigation Controller
  3. Add a TableViewController and a Segue from ViewController to TableViewController
  4. Subclass UITableViewController and UITableViewCell
  5. Set classes in Interface Builder
  6. Set Reuse Identifier
  7. Set Cell Accessory to Detail in Interface Builder
  8. Add dummy data
  9. Configure cell

The memory is leaking on the TableViewController. Just navigate to the TableViewController and then back to the ViewController.

I’m not sure why I’m running into this leak. The project looks just fine to me. Am I doing something wrong or is this a bug in iOS? Custom Table View Cells should be supporting Accessory View—right?

Hi @hettiger,
It is interesting if you try instruments on practically any of the Apple Apps. I tried with News and a couple others, there are for some strange reason unexplained leaks at the start and then at frequent intervals. Where as I did not see this in some other apps, so really cannot explain this behaviour.

cheers,

Thank you for taking the time to review this.

Hi @lewis-h

I’m not sure what you’re trying to tell me with that post…?

This topic was automatically closed after 166 days. New replies are no longer allowed.