Coming from a Java and Eclipse world, I was spoiled by great tool support for creating accessor methods (“getters” and “setters”). Xcode is sorely lacking in this area. On my current enterprise iPhone project we have a lot of domain objects and I wasn’t looking forward to typing all those accessor methods.
After some searching I came across the tool for the job: Kevin Callahan’s Accessorizer. While it’s not an Xcode plugin (it runs as a separate app), a few clever keyboard shortcuts makes it very easy to highlight your instance variables in the Xcode editor and automagically fill in the rest of the declaration and implementation. Watch the video on Kevin’s site to see how it works.
If you’re a contract iPhone developer and you think you’ll spend more than 7.5 minutes typing accessor methods over the course of the rest of your career, then Accessorizer will pay for itself. No, this is not an affiliate promotion. I just like the tool.
In Objective-C 2.0 we tend to use the @synthesize and @property statements so often that we forget how to correctly write a setter method without causing memory leaks. A bonus feature of Accessorizer is that you can study all the correct code it generates.
May 13th, 2009 at 16:39
I had not heard about this. Looks great. I just wish it was a bit closer integrated into XCode. Seems that should be possible using some AppleScript magic.
May 30th, 2009 at 20:21
[…] h/t: iPhone Development Blog! […]
September 3rd, 2009 at 13:52
I just updated Accessorizer to V1.3 which adds, per request, an IBOutlet switch to both the defaults and custom tables. It also improves the network reachability code and a few other things.