Here is how you add an IBOutlet
to a header or a .m file:
- Open your storyboard editor on one window. Position it in such a way that the button is visible
- Open the header or the .m file in another window. Position the text in such a way so that the piece of code where you want the outlet added is visible
- Highlight the button in the storyboard, and hold the Control key down.
- Drag the button into the header or the .m file. You will see a blue line as you drag, and a blue marker where the outlet will be added.
- When the marker is at the place where you want it, release the mouse button. The outlet will be inserted and connected to the storyboard.
Here is a post that illustrates this process with a video.