views:

535

answers:

1

Hi..

Im working on a part of code where a label text should change value after getting a new value from a singleton class. Seems simple enough, and after testing the value it actually changes aswell, but its not updated in the view. In the view it stays the same as before. Ive tried the code both in -(void)viewDidLoad and -(void)viewWillAppear:(BOOL)animated, but with the same result.. Any ideas?

Here are my code:

- (void)viewDidLoad {
//get the new status value
sharedBarCodeValue = [BarcodeValues sharedBarCodeValues];
if([[sharedBarCodeValue storeBarCodeValue] isEqualToString:@"123456"])
{
 [statusText setText:@"This is a new status text"];
}
//for testing, output status text
NSLog(@"status: %@", statusText.text);
[super viewDidLoad];

}

Edit: Oh, and I should mention that I´ve implemented a navigation controller, and the value should change when popping a 2. level view off the stack and going back to the root view.

+2  A: 

Ensure your statusText outlet is properly connected to your IB object.

yes.. it is connected, I`ve tried typing statusText.text = @"test"; in viewdidload, and it changes the value in the view... so this is not the problem :(
Madoc
could it have something to do with the navigation controller? maybe the view doesn`t refresh when changing from 2.level to root level in the stack?
Madoc
I'm not sure I'm following you there.
hehe.. nvm.. i´ve even tried to create new labels programatically, but they don`t show.. something is very strange.....
Madoc