Memory leaks 执行分段时避免泄漏

Memory leaks 执行分段时避免泄漏,memory-leaks,xamarin.ios,segue,Memory Leaks,Xamarin.ios,Segue,我可以使用不带分段的导航(1),但我想使用它(2) 执行segue并向后导航会使我的应用程序变慢!因为当我返回时,它不会处理目标视图。您如何正确使用此序列 /*1) This code ok! But what about segues */ if(_tabbarController==null) _tabbarController = (UITabBarController)this.Storyboard

我可以使用不带分段的导航(1),但我想使用它(2)

执行segue并向后导航会使我的应用程序变慢!因为当我返回时,它不会处理目标视图。您如何正确使用此序列

/*1) This code ok! But what about segues */ 
        if(_tabbarController==null)
        _tabbarController = (UITabBarController)this.Storyboard
                           .InstantiateViewController ("MainTabbarController");
        this.NavigationController.PushViewController (_tabbarController,true);

/*2) If I run this code I get  a new instance of UITabbar   */          
      this.PerformSegue("SegueShowDetail",this);

如果您使用的是故事板和导航控制器,则当它从堆栈中弹出时,导航控制器应自动释放您的视图及其相关内存

例如,如果您有一个方法在按下按钮转到另一个视图时被调用,您将有:

[self performSegueWithIdentifier:@"mySegueName" sender:self];

当您单击辅助视图左上角的“后退”按钮时,这将触发导航控制器处理视图。

当然,我希望看到相同的行为,但我认为对于
monotouch
来说,情况有所不同。如果我在我的应用程序上使用Segue导航,会在一段时间内变得非常慢。AFAIK for Objective-C最近实施了一些自动取消分配。当我开始使用它时,我们应该手动取消分配。