c# - Simple Segue not working in Xamarin -


i attempting simple segue in app using xamarin studio. used storyboard initiate segue using "present modally" function, every time click button perform segue in simulator receive following error:

failed marshal objective-c object 0x7f8018511770 (type: loginviewcontroller). not find existing managed instance object, nor possible create new managed instance (because type 'iosapp.loginviewcontroller' not have constructor takes 1 intptr argument).

any idea may causing problem? have attached screenshot of main.storyboard file well.

main.storyboard

the following code snippets viewcontroller.cs files , loginviewcontroller.cs codes

using system;  using uikit;  namespace iosapp {     public partial class viewcontroller : uiviewcontroller     {         protected viewcontroller(intptr handle) : base(handle)         {             // note: .ctor should not contain initialization logic.         }          public override void viewdidload()         {             base.viewdidload();             // perform additional setup after loading view, typically nib.         }          public override void didreceivememorywarning()         {             base.didreceivememorywarning();             // release cached data, images, etc aren't in use.         }      } } 

and

using system;  using uikit;  namespace iosapp {       public partial class loginviewcontroller : uiviewcontroller     {         public loginviewcontroller(intptr handle) : base(handle)         {         }          public override void viewdidload()         {             base.viewdidload();             // perform additional setup after loading view, typically nib.         }          public override void didreceivememorywarning()         {             base.didreceivememorywarning();             // release cached data, images, etc aren't in use.         }       } } 

in loginviewcontroller class ensure have following constructor can inflated storyboard:

protected yourclassnameviewcontroller(intptr handle) : base(handle) {     // note: .ctor should not contain initialization logic. } 

if class name loginviewcontroller, class like:

protected partial class loginviewcontroller : uiviewcontroller {     public loginviewcontroller(intptr handle) : base (handle)     {        // note: .ctor should not contain initialization logic.     }      ~~~~ rest of class } 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -