I am trying to load a nib file like this:
[[NSBundle mainBundle] loadNibNamed:@"PhotoViewController" owner:self options:nil];
but it makes the app crash
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.
If you’re creating the view controller programmatically, you can use the initWithNibName:bundle: view controller method
I.e.
If you’re transitioning to the view controller via storyboard, and want to have the storyboard load that view controller from a particular nib file, you could do the following:
This same question is also answered here:
Using XCode storyboard to instantiate view controller that uses XIB for its design