I’m setting a UILabel but is returning null.
.h file:
@property (retain,nonatomic) UILabel *label;
.m file :
@synthesize label;
- (void)viewDidLoad
{
self.label.text=@"some text";
[super viewDidLoad];
}
I check the value of label and is null. Can any body tell me why is null?
Can anybody tellme what I’m doing wrong?
How can I set the label from a different viewcontroller?
@Vimal’s answer does not completely answer your question. You indeed need to add this in:
But you still need to set the frame of the label and actually add the label to the view: