Fourth
Fourth

Reputation: 640

Cannot Link TextField to IBOutlet Variable

I have declared the IBOutlet variables that I want to hook up to my UI views like this in the header file:

@interface ViewController : UIViewController

@property (weak, nonatomic) IBOutlet UITextField *bookName;
@property (weak, nonatomic) IBOutlet UITextField *author;
@property (weak, nonatomic) IBOutlet UITextView *description;

@end

But when I ctrl-click from the View controller to the UI, I don't see the variables show up in the pop-up menu to be selected for linking. I see this:

enter image description here

But I expect to see the entire list of outlets

Upvotes: 1

Views: 1700

Answers (2)

Prathamesh Saraf
Prathamesh Saraf

Reputation: 699

Ok Firstly make sure that your xib's file owner is the viewcontroller you want it to be associated with like this.enter image description here

One way to see the entire list is here. You can drag and connect the outlets. This is after you have set the file owner.

enter image description here

A note. You have not yet connected the viewcontrollers view to the xib in the screenshot of your question. Hope this helps.

Upvotes: 0

ShujatAli
ShujatAli

Reputation: 1376

please check controllers class as shown in snapshot. it should point to current viewcontroller

To open this panel select your controller from story board press cmd+option+0 viewcontorller

Upvotes: 4

Related Questions