Search code examples
xcodemacosxamariniboutletxamarin.mac

Having Trouble Making a Button in Xamarin.Mac/XCode-Storyboard


Let me start off by saying I am new to XCode, but already very experienced in C#. I am having trouble getting the outlet for this button, and every time I try to Control drag it under ViewControl it only lets me do action! I have been googling for about 3 hours and trying to find tutorials, but everyone else's code looks different by default :(

Failed XCode Outlet


Solution

  • You are trying to drag into the ViewController.m file, you need to be in the header file (ViewController.h) to create an Outlet.

    Change the file being edited:

    enter image description here

    Now Ctrl-Drag into the .h file:

    enter image description here