Error when trying to create instance of HypnosisView


#1

Could anyone explain this error? My code seems to be identical to that of the book. All my files are in the right directories.

HypnoAppDelegate.m

#import "HypnoAppDelegate.h"
#import "HypnosisViewController.h"

@implementation HypnoAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    
    HypnosisViewController *hvc = [[HypnosisViewController alloc] init];
    [[self window] setRootViewController:hvc];
    
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    return YES;
}

HypnosisViewController.m

#import "HypnosisViewController.h"
#import "HypnosisView.h"

@implementation HypnosisViewController

- (void)loadView {
    CGRect frame = [[UIScreen mainScreen] bounds];
    HypnosisView *v = [[HypnosisView alloc] initWithFrame:frame];
    [self setView:v];
}

Thanks!


#2

Edit:

Found out what I did wrong. When I imported the HypnosisView h/m files I forgot to select “Add to targets: HypnoTime”.