Usually when I pass in nil as the first parameter of initWithNibName:bundle: it will automatically find the name, but sometimes it doesn’t and it just shows a black screen. Under what circumstances does this happen? There are no errors in the console window and the app happily keeps running as a black screen unless I change the nil to a string literal of the nib name. Where can I check to fix this problem?
Usually when I pass in nil as the first parameter of initWithNibName:bundle: it will
Share
I’ve never passed “
nil” in the first parameter of[UIViewController initWithNibName: bundle:]before, but Apple’s documentation says:So presumably you’re doing something in your loadView method.
It’s probably safest (and a best practice) to probably just specify the explicit .xib name when instantiating your view controller.