Hi all,
I've created a custom table view cell class that derives from UITableViewCell. I assign a custom UIButton-derived class instance to my cell's AccessoryView and EditingAccessoryView properties.
I've confirmed that my table view cell class instances' destructors and Dispose methods are called. The disposing property is set to false, indicating they are being called from the finalizer thread, not the UI thread.
If I run my app through the Xamarin Heap Shot Profiler, it shows instances of both my custom table view cell and my button class that is assigned to the cell's AccessoryView and EditingAccessoryView properties are not being released from memory. However, the cell instances are freed if I comment out the assignments of the button to the AccessoryView and EditingAccessoryView properties.
I tried adding null assignments to the AccessoryView and EditingAccessoryView properties in the Dispose method. An exception was thrown because the assignments aren't occurring in the UI thread. I wrapped the null assignments in an InvokeOnMainThread ( delegate {} ) call, but it still causes the app to crash.
Can anyone suggest the cleanest/easiest entry point when the queued cell instances are being cleaned up and I can safely assign null to the AccessoryView and EditingAccessoryView properties? Many thanks...