C++ – Generating getters & setters in XCode

cgetterobjective cxcode

I am currently using xcode for some c++ development & I need to generate getters & setters.

The only way I know is generating getters & setters in Objective C style

something like this
– (string)name;
– (void)setName:(string)value;

I dont want this; I want c++ style generation with implementation & declaration for use in the header files.

Any idea…?

Best Answer

It sounds like you're just looking for a way to reduce the hassle of writing getters/setters (i.e. property/synthesize statements) all the time right?

There's a free macro you can use in XCode to even generate the @property and @synthesize statements automatically after highlighting a member variable that I find really helpful :)

If you're looking for a more robust tool, there's another paid tool called Accessorizer that you might want to check out.