During the initial days of my development, I started always creating instance variables in every programs I wrote. But after getting to the power of properties, I felt we need not use iVars.
But at times when I had to debug the code, I found the difficulties in debugging custom entities’ values due to the iVars being missing.
Now I am planning to have iVars on all the Custom interface implementations.
Please confirm if what I have been doing is a good practice, does it have a trade-off?
Is there any other reason we need to use iVars in Objective C?
You aren’t “not using” iVars by using properties (most of the time). You are just letting the compiler generate them for you. I use private and protected iVars often for things that I don’t want exposed to outside unrelated classes (flags, etc). Properties are just iVars coupled with defined getters (and setters possibly). I don’t understand what you think you are gaining by avoiding explicit iVars.