I have two UIView
contained in a UIViewController
- firstView
and secondView
- that I initialize pragmatically. I have a UILabel
in the firstView
, and a UIButton
in the secondView
. I would like the button in the second view to change the label in the first view. In the implementation file of the second view I have the following code:
- (void) changeLabel: (UIButton *) sender{
firstView *view = [[firstView alloc] init];
view.label.text = @"Changed Text";
}
However I figured out that the above method just initializes a new class of firstView and does not link to the existing UIView
. How can I change properties of firstView
from within secondView
?