i have a viewcontroller with a textview and a label and i want to change the text on both of them before i load the view.
- (IBAction)loadCardInformation:(id)sender{
ciViewController = [[CardInformationViewController alloc] initWithNibName:@"CardInformationViewController" bundle:nil];
[ciViewController.infoLabel setText:@"ROFL"];
[ciViewController.infoText setText:@"CAKE"];
[self.view addSubview:(UIView *)ciViewController.view];
}
I have hooked both the label and the textview to outlets, but nothing is changing.
You need to set these in
viewDidLoadof the viewController. At the point where you are currently setting the properties they have not been loaded.Also
this looks like something you should most likely not be doing.