Hey everyone, I am following the book, enjoying it a lot, well done.
I’m here in chapt. 17, changing things over from standard wordy accessor method declaration to properties and @synthesize syntax. (page 105) Everything is now nice and concise, it all makes sense, looks great, but I get red fail flags in my main code… Why? I couldn’t figure it out! I eventually changed my ivar setting code in the .main to dot notation and the code worked again. This was odd to me since apparently dot notation is not what A.H. wants us to use. There must be another way…?
Before reading further, does anyone know what my problem was?
So after a bunch of web searching I find a tiny tidbit of knowledge on some blog…
“When using auto synthesized accessor methods, Obj-C needs you need to capitalize the first letter of the variable”.
So my original code below was broken:
But works fine after changing it to this:
Was this mentioned in the book? I have no object oriented experience before this, maybe it makes sense and is straight forward for some reason?? Or is it just one of those Obj-C things?