I’m very new on iPhone development. I wondering where to put some custom initialization of an instance variables for my UIViewController.
Can I use initWithNibName:bundle:?
Thanks.
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.
initWithNibName:bundle:is the designated initializer, and should be used for custom initialization of the view controller. You should use this for the instance variable code that should run once, on creation of the view controller, except for views controlled by this view controller.The views may come and go in the run of the application. Therefore you may want to initialize the view more than once from one view controller object. You should place the view initialization code in
loadViewif you are not using a nib for the view, orviewDidLoadif you are using a nib.