Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can the value of the Identity Label be accessed in code?

I have a number of labels in Interface builder which all have their identity label set (Identity inspector > Identity > Label.

I would now like to access these labels in my code. Is this generally possible or is this only present within Interface builder?

like image 432
Besi Avatar asked Sep 14 '11 08:09

Besi


1 Answers

It would not be possible to access each labels Identity inspector > Identity > Label in your code. To better understand what the Identity label does, check out this link:

Label property in identity inspector

It would probably be better if you just accessed the label using the defined IBOulet. If you want to try something that is similar you could just set the tag property like so:

label.tag = 1;

Give each label a unique tag and you should be able to access it using

UILabel *label = [self.view viewWithTag:1];

like image 74
ms83 Avatar answered Sep 30 '22 02:09

ms83