Displaying text in UILabel in iPhone

Posted by SeniorLee on Stack Overflow See other posts from Stack Overflow or by SeniorLee
Published on 2010-12-26T05:05:28Z Indexed on 2010/12/26 15:54 UTC
Read the original article Hit count: 196

Filed under:
|
|

OK. What's wrong with my code?


- (void)viewDidLoad {
    [super viewDidLoad];

    lblResult = [UILabel alloc];
}

- (void)viewWillAppear:(BOOL)animated {
 lblResult.text = @"BlahBlah";
}

I linked lblResult to Label object in IB well. But the label only shows the default text. Where's my BlahBlah??

And when the default string I set in the IB actually set to lblResult??

The reason that BlahBlah string is not displyed is I guess because lblResult.text is over-written by default string specified from IB. Just my guess.

Can anyone make me clear with that?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c