views:

223

answers:

4

Are there any tools out there for Objective-C / Xcode? Something that can do one or more of the following:

  • Detect unused imports
  • Auto-synthesize properties
  • Autogenerate dealloc method from retained properties
  • Provide method stubs for interface
A: 

You could probably do something with AppleScript or another scripting language, called via AppleScript, to operate on method or header files.

Alex Reynolds
+1  A: 

You want to look at Kevin Callahan's Accessorizer, which can do several of the things you request and more. The Google Toolbox for Mac also includes an Xcode plugin that can remove whitespace and a few other things.

Felixyz
+1  A: 

-Detect unused imports

Not sure of anything that checks for dead imports.

-Auto-synthesize properties *-Autogenerate dealloc method from retained properties*

User Scripts work quite well to do this inside Xcode, you can also use a program like Acessorizer as mentioned but it pastes something onto the clipboard for you to paste.

-Provide method stubs for interface

type "init" just after @implementation, and type Control-. (period).

These are user macros (not scripts), and you can easily define your own. Note they have placeholders that you can use tab to jump to the bits to fill in.

Kendall Helmstetter Gelner
A: 

If you want static analysis, Clang is built in to all recent releases. None of what you've described has anything to do with static analysis, however.

Azeem.Butt
The first one (unused imports) does, it's traditionally the domain of static analyzers to tell you about dead code (which CLANG does in other contexts)
Kendall Helmstetter Gelner