Reputation: 8916
Must be using wrong keywords in search because I can't find any answer to this.
I don't use much of a Visual Studio to build UIs but I do remember that double click on UI component event (like Button OnClick) automatically creates a hander method in supporting C# class.
So is there maybe a magical combination of keys or clicks to achieve the same effect in XCode IB?
Upvotes: 0
Views: 106
Reputation: 11770
In xcode open your nib(xib) file, switch the xcode to the 'Assistant Editor' mode. Select .h(header) file of your class on the right side of the editor. Select your button in the interface, and by holding the button with the right mouse button drag it to the .h(header) file, you will see the line drawn between your button and header, when the right end of the line is in right place on the header, release the right button of the mouse. Now you should see the menu for creating IBOutlet and IBActions. On the top of the menu you can choose between creating IBOutlet or IBAction, choose action and name your method and hit enter. That's it :) Good luck!
Upvotes: 2