1

I basically have code that reflects the answer from Connect a UILabel in Interface Builder and XCode?.

In one view controller I have several UILabels whose text is set by some other methods I have written in viewDidLoad. This has worked fine, but today I tried adding a couple more labels in the same fashion and I can't get their references to show up in the Outlets list in Interface builder. How does identical code not work in the same view controller?

Community
  • 1
  • 1
user990769
  • 115
  • 2
  • 12

1 Answers1

3

1) Make sure you have written the IBOutlet property correctly,

enter image description here

2) File's Owner Custom Class of Your .xib should be your ViewController class

enter image description here


3) If you right click on the File's Owner which is listed under Placeholders, The IBOutlet myLabel should be there,

enter image description here


4) And make sure you have connected the IBOutlet to your UILabel.

enter image description here


5) Set the text of the Label from your viewDidLoad method,

enter image description here

Thilina Chamath Hewagama
  • 9,039
  • 3
  • 32
  • 45