Just a simple question…I’m using Interface Builder for creating my view, and I wonder where I should initialize my UIViewController’s member variables (which are not IBOutlets)…viewDidLoad? awakeFromNib? initWithCoder:?
Thanks for your answers!
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.
Use
awakeFromNibif you need to do anything extra with your IB outlets before the view is actually loaded (so at the time post when the NIB is loaded), otherwise you can normally initialise member variables inviewDidLoad:In general, if you follow how Apple’s samples initialise member variables you’ll be fine; you only need to consider changing the location of member initialisation if it’s not appropriate to do it when the view is loaded.