I want to edit a UILabel which is in ViewContrller2 from ViewController1.
This is my code, but it is not working:
ViewController1.m:
// ....
// In my viewDidLoad :
ViewController2 *vc = [[ViewController2 alloc]init];
// calling a function :
[vc updateLabel];
// ....
ViewController2.m:
// ....
-(void)updateLabel{
self.MyLabel.text = @"Text";
// MyLabel is already declared in ViewController2.h
}
// ....
Please can you help me?
I've tried many codes, but it's still not working and I don't know where the problem is.