开发者

How to set a default value to a UITextField when the application is loaded?

I'm a Objective-C newbie and I'm 开发者_运维技巧currently trying to build an app which has a UITextField (called "initial_dose") and I'm wondering how can I set a default value which will be visible straight after the application is loaded.

I kind of know how to set the value but not sure where I need to call this?

initial_dose.text = "@myInitialVal";

Thanks a lot in advance!


Yes, in :

- (void)viewDidLoad {
    [super viewDidLoad];

    initial_dose.text = @"myInitialVal";
}

Which should I use, -awakeFromNib or -viewDidLoad? - for more info.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜