0

I'm learning iOS development from an older version of a book. I used an Empty Template & I'm getting a runtime error in 'main.m' although the code seems fine there:

return UIApplicatio Main(argc, argv, nil, NSStringFromClass([AppDelegate class]));

I imported "HypnoView.h" objective C class in AppDelegate.m In AppDelegate.m I added this code in '- (BOOL)applicarion:.....' :

CGRect firstFrame = CGRectMake(160,240,100,150);
HypnoView *firstView = [[HypnoView alloc] initWithFrame:firstFrame];
firstView.backgroundColor = [UIColor redColor];
[self.window addSubview:firstView];

Book does mention I'll will get this exception as a warning or comment. But i'm getting a runtime error.

N4SK
  • 700
  • 8
  • 25
  • The code (at least the last line anyway) you have posted is many years out of date. Please find an up-to-date tutorial/book. – rmaddy Feb 05 '17 at 05:14
  • Thanks for the answer. I wil get the up to date edition. – N4SK Feb 05 '17 at 06:58

0 Answers0