Problem creating BNRHypnosisViewController


Hey everybody, hope you are having a great day. I am currently starting chapter 6 of the book and I am encountering an issue and I can’t find the problem. I create the HypnoNerd project, drag the BNRHypnosisView.h and .m, but when I create the new file for the BNRHypnosisViewController, as soon as I change the superclass from NSObject to UIViewController I get these error messages:

"Class “LBAHypnosisViewController” defined without specifying a base class"

"Cannot find interface declaration for “UIViewController”, superclass of “LBAHypnosisViewController”. "

Could this be because I am using Xcode 6?I did it all over again and I get the same error.

Here is my code, it says :“add a superclass to fix this problem” but even if I do, still doesnt work. :

#import <Foundation/Foundation.h>

@interface LBAHypnosisViewController : UIViewController


Thanks everybody, have a great day!



Assuming the code shown is in LBAHypnosisViewController.h (not .m), it’s fine; the issue is elsewhere.

Have you been using Xcode 6 for the prior chapters as well, or did you switch beginning only with chapter 6?


Hey everyone. Yes I did use xcode 6 for previous chapters. Apparently the problem came from not importing the #import , as soon as I did that, no more issues!


Very interesting; thanks for the tip!


It actually needs to be #import <UIKit/UIKit.h> as Foundation doesn’t include UIViewController.


shall be #import < UIKit/UIKit.h >
not #import < Foundation/Foundation.h >