Neep help with XIB approach to Silver Challenge


#1

I’m very stuck and feeling very frustrated. I finished the BNR 7Day iOS bootcamp, but cannot get past this Silver challenge.

How do I use my programmatically created UIView HypnosisView in a XIB file?

I have HypnosisViewController.xib, and in this XIB file I have …
– Identity inspector shows that Class for File’s Owner is HypnosisViewController
– Connections inspector for File’s Owner shows an Outlets connection from view to HypnosisView
– Identity inspector for HypnosisView shows that the Class is HypnosisView (and Hypnosis View is shown in the Document Outline).
– The Connections inspector for HypnosisView shows a Referencing outlet from view to File’s Owner.

I commented out loadView in HypnosisViewController.m, but after that I’m at a complete loss as to how to move forward. Do I need to implement an initWithNibName: bundle: in my HypnosisView class??

My HypnosisView class is not an archived object, correct? So I don’t really see how to bridge the gap to InterfaceBuilder with HypnosisView.

Thanks.


#2

Looks like implementing awakeFromNib in the HypnosisView class was the key.

If anyone else is looking for more on this, I found the Stanford iTunesU iPad and iPhone Application Development Lecture 5 - Protocols and Gestures (October 11, 2011) pretty helpful, especially where the instructor starts working through the Happiness app demo.