Reputation: 16215
So I'm just trying to create a very simple app for demo purposes here:
Added the following code to my controller's header file:
@property (weak, nonatomic) IBOutlet UIView *myView;
Now, I understand that I can link the UIView to the controller by:
My question is this: can I do this without Ctrl-drag? And if so, how?
More specifically - it's annoying to have to put both my header file and storyboard on screen at the same time, and it seems there should be a way to make this connection without doing so.
I also understand that I can manually place the view by creating it inside my controller's viewDidLoad function, but I'd really like to use the interface builder to simplify / visualize things.
Edit: Is the answer to my question affected whether I use storyboards or xib/nib files? (I'd switch to use the one where it works)
Upvotes: 7
Views: 16503
Reputation: 78
In addition to Dima's answer, you can just as well use the Connection inspector in the Utilities pane
Upvotes: 4
Reputation: 23634
you should be able to right click the element, and drag the "referencing outlet" item to the view's "File's Owner" in interface builder. There, it will give you a list of all available IBOutlets (matching the object's type).
Upvotes: 5