So I'm writing an app that uses the same view controller multiple times, however whenever I allocate it, change the text of a label in the controller, and then push it onto the navigationController, the label stays exactly the same. I have a uilabel in the xib file linked up with the IBOutlet in the infoController class definition. However nothing comes up when I actually run in the simulator.
Here is what infoController looks like:
This is actually how I'm allocating and changing the text of the label in the infoController instance.
I've done this many times and have no clue why it's not working now. Any help would be greatly appreciated.
Here is what infoController looks like:
Code:
@interface infoController : UIViewController {
IBOutlet UILabel * infoLabel;
}
-(void) setInfoString: (NSMutableString*) infoString;
@end
@implementation infoController
-(void) setInfoString: (NSMutableString *) infoString{
infoLabel.text = infoString;
}
@end
This is actually how I'm allocating and changing the text of the label in the infoController instance.
Code:
infoController * newController = [[[infoController alloc] initWithNibName:@"infoController" bundle:nil] autorelease];
[newController setInfoString:dataString];
[[self navigationController] pushViewController:newController animated:YES];
I've done this many times and have no clue why it's not working now. Any help would be greatly appreciated.