How to set a default value to a UITextField when the application is loaded?
-
21-09-2019 - |
Question
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!
Solution
Yes, in :
- (void)viewDidLoad {
[super viewDidLoad];
initial_dose.text = @"myInitialVal";
}
Which should I use, -awakeFromNib or -viewDidLoad? - for more info.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow