我在我的osx应用程序中使用简单的拆分视图控制器...拆分项0用于菜单,第二项用于内容(如松弛应用程序)。
我得到内存泄漏,所以需要优化......这是我点击菜单项时的操作:
partial void SettingsClicked (NSObject sender)
{
HighLightMenuItem (SETTINGS_INDEX);
var svc = ParentViewController as NSSplitViewController;
SettingsVC = SettingsVC ?? Storyboard?.InstantiateControllerWithIdentifier ("settingsViewController") as SettingsViewController;
var svi = new NSSplitViewItem ();
svi.ViewController = SettingsVC;
DisableBack ();
svc.RemoveSplitViewItem (svc.SplitViewItems [1]);
svc.InsertSplitViewItem (svi, 1);
}