Unable to show view loaded from NIB

#1

I am able to compile the program without errors but am unable to get the CHJReminderViewController view to render on the screen.
Any help on this would be greatly appreciated. I’ve spent at least an hour and a half going through my code and what’s in the book.

I’m using Xcode 7.1.1 and iOS 9.1.

My code is here: https://github.com/collenjones/HypnoNerd

Thanks!

#2

So if anyone else get’s stuck with this, the problem I was running into was SIZE CLASSES (and a lack of constraints).

To fix this:

  1. Make sure your Interface Builder view is w Any h Any (mine was w Compact h Compact). You should be able to see the width and height of your view at the bottom center of the IB. When I changed my IB view size to Any/Any, the view suddenly was blank, reflecting what I was seeing when the app was built.
  2. Add constraints!
  • Control-Click the DatePicker and drag it to the view to set Leading Space, Trailing Space and Top constraints.
  • Control-Click the Button and drag it to the DatePicker to set a Vertical Spacing constraint. Then Control-Click and drag to the view to set Leading and Trailing space constraints.

This took me several HOURS to solve and I found size classes pretty confusing. You can read up more on them here: https://developer.apple.com/library/ios/recipes/xcode_help-IB_adaptive_sizes/chapters/AboutAdaptiveSizeDesign.html
http://adoptioncurve.net/archives/2014/08/working-with-size-classes-in-interface-builder/

Godspeed.