Question

I am working on a large iOS application and am at the phase where I'm doing some cleanup/performance tuning.

One of the things I need to do is override ViewDidUnload everywhere and take the appropriate action, and the most common thing that needs to be done is to set all outlets within the UIViewController to null. Is there a way through MonoTouch APIs to get a list of connected outlets in a UIViewController? This will make this process much more robust, as I won't have to do anything if I add new outlets.

NOTE: I know setting all outlets to null won't catch every referenced view, but should get a large portion.

Was it helpful?

Solution

Looks like Xamarin has been at work to fix this in the latest version of MonoTouch/MonoDevelop .

There is a designer-generated ReleaseDesignerOutlets() that you can call in ViewDidUnload. You can view the method in any *.designer.cs file.

Not sure if there is a good way to fix existing views created prior to the latest MonoDevelop, however.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top