我在使用xamarin工作室的应用程序中尝试简单的塞格。我用故事板开始使用“当前模态”功能SEGUE,但每次我按一下按钮,在我收到以下错误模拟器进行SEGUE:简单的塞格不在Xamarin中工作
Failed to marshal the Objective-C object 0x7f8018511770 (type: loginViewController). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'iOSApp.loginViewController' does not have a constructor that takes one IntPtr argument).
任何想法,以什么可能导致问题?我附上了我的main.storyboard文件的截图。
下面的代码片段是我ViewController.cs
文件和loginViewController.cs
码
using System;
using UIKit;
namespace iOSApp
{
public partial class ViewController : UIViewController
{
protected ViewController(IntPtr handle) : base(handle)
{
// Note: this .ctor should not contain any initialization logic.
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}
}
}
和
using System;
using UIKit;
namespace iOSApp
{
public partial class loginViewController : UIViewController
{
public loginViewController(IntPtr handle) : base(handle)
{
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}
}
}
你'loginViewController' .actor是调用错误的基础上,将其更改为匹配我的回答的那些 – SushiHangover
而对于将来,请不要添加代码的*截图*,将代码添加为文本。它是可搜索和容易审查的其他人,截图不是... ;-) – SushiHangover
改变了问题,以反映建议以及代码(如上所示),但是,在模拟器中运行相同的问题相同的错误代码 – bananibau5