I have several modals in my application , here is extentions method what I use for every of them:
public static void CloseAndDismissViewController (this NSViewController vc)
{
vc.View.Window.Close ();
vc.DismissController (vc);
vc.RemoveFromParentViewController ();
}
But I doesn't deallocate memory, here is screen shot from profiler :
finally , such cases cause application crashes....
I'm using PrepareForSegue method to pass data from source to destination vc, like this one :
public override void PrepareForSegue (NSStoryboardSegue segue, NSObject sender)
{
if (segue.Identifier.Equals ("ImageInfo")) {
var vc = segue.DestinationController as InfoViewController;
vc.SetData (item);
}
}