Getting error after @synthesize


#1

When I run the program with the normal hand-coded accessors, it works fine.

When I replace the accessors with the synthesize command, I get this error on run:

2013-10-11 21:25:46.982 BMITime[498:303] -[Person bodyMassIndex]: unrecognized selector sent to instance 0x1001082b0 2013-10-11 21:25:46.984 BMITime[498:303] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Person bodyMassIndex]: unrecognized selector sent to instance 0x1001082b0' *** First throw call stack: ( 0 CoreFoundation 0x00007fff931b8b06 __exceptionPreprocess + 198 1 libobjc.A.dylib 0x00007fff92d6b3f0 objc_exception_throw + 43 2 CoreFoundation 0x00007fff9324f40a -[NSObject(NSObject) doesNotRecognizeSelector:] + 186 3 CoreFoundation 0x00007fff931a702e ___forwarding___ + 414 4 CoreFoundation 0x00007fff931a6e18 _CF_forwarding_prep_0 + 232 5 BMITime 0x0000000100000ccd main + 173 6 libdyld.dylib 0x00007fff90b727e1 start + 0 ) libc++abi.dylib: terminate called throwing an exception (lldb)

In main.m, I am getting a message on this line of code:

float bmi = [person bodyMassIndex];

Error is “Thread 1: signal SIGABRT”


#2

OK I figured this out. The synthesize does not address the bodyMassIndex method. I had commented out that entire block.