In trying to debug why a view controller is initing empty, I’ve ended up a sort of weird place. Check this out:
OffersSearchController *searchController = [[OffersSearchController alloc]
initWithNibName:@"This is a completely bogus nib name."
bundle:nil];
Not a single complaint. I’ve seen that sort of construct crash out with complaints about being unable to find a nib named “This is a completely bogus…”, but not this time. Instead, my searchController pushes onto the navigation controller as if it had loaded successfully. It’s empty, though–I can see the full screen of another view that’s (accidentally!) “underneath” my UINavigationController stack.
What’s happening here? Is [OffersSearchController alloc] coming back nil for some reason?
EDIT: Never mind. Here’s the lesson: don’t implement loadView when you mean to implement viewDidLoad. Oy. Long week.
Here’s the answer (thanks @Eric Petroelje for suggesting I post and accept the answer).
In a burst of late-Friday-afternoon productivity, moving far faster than is recommended, I set up my property initializers and picker-wheel-data-source arrays in
-(void)loadViewrather than in-(void)viewDidLoad.Rather than the
initWithNibName:call’s call to loadView being allowed to propagate up to UIViewController, it happily initialized my fields and that’s all.