Author Topic: Chapter 7 page 103  (Read 2565 times)

dblue829

  • Newbie
  • *
  • Posts: 1
    • View Profile
Chapter 7 page 103
« on: June 17, 2015, 09:56:20 AM »
after using "importing the class header" the code line;      calculator = [[Calculator alloc] init]   throws an error;  Use of undeclared identifier 'calculator' can't seem to find the problem as to why?

kjmcneish

  • Administrator
  • *****
  • Posts: 717
    • View Profile
Re: Chapter 7 page 103
« Reply #1 on: June 17, 2015, 10:46:45 AM »
You will get this compiler error if the calculator instance variable has not been declared. Check your ViewController.m file and make sure you have this declaration near the top of the file:

Code: [Select]
@implementation ViewController
{
Calculator *calculator;
}

All the best!
Kevin