C# 从其他项目推送ViewController时出错
在第一个项目中,我有一个C# 从其他项目推送ViewController时出错,c#,ios,uiviewcontroller,xamarin,pushviewcontroller,C#,Ios,Uiviewcontroller,Xamarin,Pushviewcontroller,在第一个项目中,我有一个ui按钮。当我触摸它时,将从另一个项目中打开其他UIViewController。但我有一个问题: 这是我对第一个项目的代码,我将使用它从另一个项目调用其他UIViewcontroller public partial class SomeSoluctionViewController : UIViewController { public SomeSoluctionViewController (IntPtr handle) : base (handle) { }
ui按钮
。当我触摸它时,将从另一个项目中打开其他UIViewController
。但我有一个问题:
这是我对第一个项目的代码,我将使用它从另一个项目调用其他UIViewcontroller
public partial class SomeSoluctionViewController : UIViewController
{
public SomeSoluctionViewController (IntPtr handle) : base (handle)
{
}
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
PushedClassController pushedclass = PushedClass.AppDelegate.Storyboard.InstantiateViewController ("PushedClass") as PushedClassController;
CallButton.TouchUpInside += (object sender, EventArgs e) => {
this.NavigationController.PushViewController (pushedclass, true);
};
// Perform any additional setup after loading the view, typically from a nib.
}
}
我按照Xamarin的网站指示使用PushViewController
我用标识符实例化第二个类
在PushedClassController的AppDelegate上:
public static UIStoryboard Storyboard = UIStoryboard.FromName ("MainStoryboard", null);
namespace PushedClass
{
** [Register ("PushedClass")]**
public partial class PushedClassController : UIViewController
{
public PushedClassController (IntPtr handle) : base (handle)
{
}
}
}
我在上面使用它。
这是第二个项目的pushedView:
public static UIStoryboard Storyboard = UIStoryboard.FromName ("MainStoryboard", null);
namespace PushedClass
{
** [Register ("PushedClass")]**
public partial class PushedClassController : UIViewController
{
public PushedClassController (IntPtr handle) : base (handle)
{
}
}
}
注册为“PushedClass”
日志:引发Objective-C异常。名称:NSInvalidArgumentException原因:情节提要()不包含标识符为“PushedClass”的视图控制器。在xamarin中打开推送的项目 通过单击底部的黑条选择要显示的视图控制器 在identity下的designers属性栏中,为情节提要ID和还原ID指定一个唯一的ID,以
推送类