where do you programmatically set text for UILabels in a UIView?
I tried in the init method and this doesn’t work. It doesn’t set the text.
I’ve put the code in the parent controller that uses the UIView within it, but to me it would make more sense if I put it somewhere in the UIView code.
Background – doing programmatically has I’m doing localisation on the text
Your initialization code should be in
initWithFrame:, UIView’s designated initializer.Alternatively you can implement
awakeFromNibwhich is called on an object (such as a view) once it has been unarchived from a nib file.