I would like to be able to update myViewController's UILabel called score from myClass embedded in myViewController.
In myClass I created a pointer to myViewCOntroller called parent. I assigned the view pointer in the init of myClass using:
MyAppDelegate * appDelegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate];
self.parent = [appDelegate viewController];
I've forward declared the viewController in .h and imported to the the .m of myClass
When I get to the setLabel function in myClass, the parent pointer variable looks good, and so does the UILabel variable, and even the label's text but the label doesn't get updated after
NSString * text = [[NSString alloc] initWithFormat:@"Score, %d!", score];
parent.score.text = text;
Currently I'm creating the UILabel using the Interface Builder. I dragged from the control to the header file to create the variable and the preperty functions, and right-clicked on File's Owner to connect the control outlet to the variable.
I noticed that I can update the label form the viewController but not from myClass.
Any ideas of what I doing wrong?