I have a question similar to this question but it is MonoTouch specific. When I need to call NavigationController.PopToRootViewController(), I’m currently on the 8th view controller on the stack and I need to clean up a bunch of stuff (references, events, images, etc.) on all the view controllers that get popped off, how would I do this?
I have a question similar to this question but it is MonoTouch specific. When
Share
I ended up implementing a
Cleanup()method on each view controller. Set up the view controllers to observe for a certain notification from theNSNotification.DefaultCenter. When time comes to callPopToRootViewController()then post that notification event. View controllers observing this notification would be set to runCleanup()which would safely clean up all refs and memory.