I have a problem with overriding method using Xcode 6.1 and OS X 10.10 Yosemite. In this chapter the book says
“Because BNREmployee inherits from BNRPerson, everyone already knows that instances of BNREmployee will respond to a bodyMassIndex message. There is no need to advertise it again, so you do not declare it in BNREmployee.h.”
…but in Xcode 6.1 something probably changed because i got an error in BNREmployee.m:
“Because BNREmployee inherits from BNRPerson, everyone already knows that instances of BNREmployee will respond to a bodyMassIndex message. There is no need to advertise it again, so you do not declare it in BNREmployee.h.”
…but in Xcode 6.1 something probably changed because i got an error in BNREmployee.m:
use of undeclared identifier ‘[color=#FF0000]bodyMassindex[/color]’[/quote]
You probably have a camelCasing problem: bodyMassIndex vs [color=#FF0000]bodyMassindex[/color]
Make sure that you type in exactly what the book is asking you to type in - names are case sensitive.
I had the exact same problem, and it was not a typo. The mistake I made was to declare the override INSIDE the yearsOfEmplyment method. Take it out just befor @end. Hope this helps.