Where is it proper to add an UIDatePicker? Should I add it in viewDidLoad? Or in loadView?
This UIDatePicker should be a subview of the main view, and will be displayed the entire time that this viewController’s view is displayed.
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends on whether you are loading your view from a nib or programmatically.
If you are loading from a nib, you want to use viewDidLoad.
If you are loading programmatically, you can use either, but to keep all of your view loading logic in one method, you should use loadView.