Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode4 Automatic Generation of @property declarations and all that goes with it

When I was using Xcode 3 I had configured it with a perl script I found on the web that allowed me to automatically generate the @property, @synthesize and dealloc code for new instance variables. Xcode 4 doesn't have that User Scripts menu though.

Is there a way to plug in these kinds of User Scripts for Xcode 4 or does Xcode 4 have a new feature that generates that stuff automatically? (I've looked and can't find one though).

I'm not talking about linking to IBOutlets. I know that I can drag from a xib and it will create all of the right stuff for IBOutlets, but I'm looking for something that will create @property, @synthesize and dealloc code for any instance variable.

Thanks, Kenny

like image 960
Kenny Wyland Avatar asked Apr 07 '11 22:04

Kenny Wyland


1 Answers

I would strongly (and I can't emphasize this enough) suggest the application:

Accessorizer

This is by far the most useful application for writing objective-C and objective-C 2.0 code that I have found. Originally written in the pre ObjC2.0 days, it created ivar getters and setters for you. Over the years it just keeps evolving. Now it does properties, container classes, key value encoding, KVO.

It tailors to your style: What line do you put brackets on, how do you indent, how do you comment? It also installs as a service so you can call it up from XCode, copy to the clipboard and paste right back into XCode.

I am not the author, I get nothing for plugging this. However, I have introduced its usage to every Mac team I've worked on and have converted every Obj-C programmer to it on first use.

It's got a demo period. Definitely at least try it out and see if it solves your issue.

like image 69
Dru Freeman Avatar answered Sep 23 '22 20:09

Dru Freeman