SuperFrog
SuperFrog

Reputation: 7674

Xamarin.iOS/monotouch memory management

I’m trying to understand the memory management needed in Xamarin.iOS.

In the following scenario, does this.NavigationController.PopToRootViewController release the created UIViewControllers or should I release them? If I need to do it, where should this be done?

Each letter represent a UIViewController)

A ( rootViewcontroller)

from A:

B b = new B()
this.NavigationController.PushViewController (b, true);

From B:

C c = new C()
this.NavigationController.PushViewController (c, true);

From C:

D d = new D()
this.NavigationController.PushViewController (d, true);

From D:

this.NavigationController.PopToRootViewController(true);

Upvotes: 0

Views: 194

Answers (1)

miguel.de.icaza
miguel.de.icaza

Reputation: 32694

Can you enable "Use Reference Counting Extension"? This will take care of this for you.

enter image description here

Upvotes: 1

Related Questions