Check your designer file for your ViewController, it will have something like this:
using Foundation; using System; using System.CodeDom.Compiler; using UIKit; namespace TEST { [Register ("ViewController")] partial class ViewController { [Action ("ButtonPressed:")] [GeneratedCode ("iOS Designer", "1.0")] partial void ButtonPressed (UIButton sender); void ReleaseDesignerOutlets () { } } }
So, just implement this method as follows:
using System; using UIKit; namespace TEST { public partial class ViewController : UIViewController { public ViewController (IntPtr handle) : base (handle) { } public override void ViewDidLoad () { base.ViewDidLoad (); } partial void ButtonPressed (UIButton sender) { Console.Write ("HEY mark this answer as accepted"); } } }
source share