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
3 comments

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.

0

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

0

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.

0

Please sign in to leave a comment.