Generate getters for instance variables.
@interface YAxisConstraints : NSObject {
int _yAxisMin;
int _yAxisMax;
int _yAxisSteps;
}
If I have the following class is there a way to generate getters without using properties in App Code?
Thanks,
Dave
请先登录再写评论。
No, it's only possible using properties. But why do you use instance vars instead of properties?
BTW, you can convert your ivars to the properties using the Refactor | Convert to properties action.
Hi -
I actually did convert them to properties. I use instance variables if they are private and not used externally. Old habits from C++ and Java programming. I use properties if the variables can be changed outside the class.
Thanks!
Dave
If you want the private properties, it's a good style to put them to the private category. AppCode has the spacial "Declare members" action, you can move the properties between the interface and the private category using it.