Error after synthesizing properties


#1

Working in Chapter 3 and I have added properties to the Possession.h file and then added the synthesize call in Possession.m.

At this point, I get a warning from Xcode regarding:

line in the initWithPossessionName initializer.

The warning is: Instance method ‘-setValueinDollars:’ not found (return type defaults to ‘id’) and I get a ‘NSInvalidArgumentException’ when I try to run the code.

All of the other self calls in the init work fine (when I comment out the offending line, it runs but all the values are zero since it can’t call the value method). I am assuming this has something do with it being a primitive and not an object, but I’m not sure where I have gone wrong.

Thanks,

Matt


#2

Matt,

The first thing I would do is check the spelling of your variable.

I see you have setValueinDollars with a lowercase “i”, whereas you will probably have it as valueInDollars (capital “I”) in the interface file.

Nick
http://myfirstiphoneapp.co.uk
http://easyintervalsapp.co.uk


#3

Nick,

Yep - that was it. I must have looked at it a thousand times and completely missed it.

Thanks for your help.

Matt