Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/329.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 从其他项目推送ViewController时出错_C#_Ios_Uiviewcontroller_Xamarin_Pushviewcontroller - Fatal编程技术网

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,以
推送类