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 :(
Asked
Active
Viewed 411 times
1 Answers
5
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:
Now Ctrl-Drag into the .h
file:

SushiHangover
- 73,120
- 10
- 106
- 165
-
YOU ARE THE BEST! Sorry for such a silly mistake! I added an outlet to change stuff like the title, and I added a action for the click event, but how would I have a event for both click and say onhover? Is that possible, or are events a little harder here than in Visual Studio? – Sean Mitchell Feb 14 '18 at 11:54
-
@SeanMitchell Xcode's UI takes a while to get the hang of... ;-) For `MouseEntered`, `MouseExited`, ..., just subclass `NSButton` and provide the method overrides, for "click" I normally just use the Xamarin/C# normalization of the `Activated` EventHandler (`button.Activated += SomeDelegate;`) – SushiHangover Feb 14 '18 at 12:06