문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top