2013-04-12 47 views
0

James Clancey在monotouch上使用弹出窗口导航。无法让子视图控制器在主控制器上优雅地执行一个循环?FlyoutNavigation子视图控制器无法在主控制器上执行segue?

 NavigationRoot = new RootElement ("Navigation") { 
      new Section ("Menu") { 
       new StringElement ("Mapview Controller"), 
       new StringElement ("Another View Controller"), 
      } 
     }, 

     ViewControllers = new [] { 

     // mapview is a view inside this viewcontroller and able to perform segues 
      new UIViewController { View = mapView }, 

     // this is a seperate viewcontroller but is embedded inside the flyoutNavigation 
    // AnotherViewController cant seem to call the root navigation controller (<-- actually a uiNav inside a tab bar nav) so i can perform a segue movement just like the above mapViewController?? 
      this.Storyboard.InstantiateViewController("AnotherViewController") as AnotherViewController, 

     }, 


    // sub viewcontroller i.e. AnotherViewController trying to move mainViewController to perform a segue.. 
    // throws error: Receiver (<FlyoutNavigation.FlyoutNavigationController: 0x14360600>) has no segue with identifier 'segueTest' 

    this.ParentViewController.PerformSegue("segueTest", this); 

*更新: 我放弃了SEGUE。而不是使用附加视图控制器,我依靠的意见,但我的观点一个是静态的单细胞的tableview和不知道如何将它添加到上面的代码liek这样:

 ViewControllers = new [] { 
      new UIViewController { View = mapView }, 
      new UIViewController { View = myTableView } // doesnt work - tried with 'new UITableViewController' which also fails 

我该怎么办?

回答

0

您可以使用导航功能的..

ViewControllers = new [] { 

new UINavigationController (this.Storyboard.InstantiateViewController("profileViewController") as ProfileViewController), 
} 
+0

如何在AppDelegate类中获得故事板的实例?我有一个类似的问题,我使用FlyoutNavigationController作为根,因此需要在AppDelegate中实例化控制器,并且它们正在使用Storyboard – appcoder

相关问题