My Links

iOS Developer | CV | linked in | stack overflow | twitter | rsaunders100 at gmail dot com

26 Jan 2012

Finding unused images in your project

I game across a nice program to check a XCode project for unused images.  Its based on a Stack Overflow question.

How to use it:

  1. Download this GIST.
  2. Extract it and move it inside to your XCode Project directory.
  3. Navigate to the folder in the terminal.
  4. Run the shell script (type "sh").
  5. The program outputs a list of images that it thinks are not used

You have to be careful because the program will give a false positive if the file names are generated dynamically.  E.g. 

NSString *imageName = [NSString stringWithFormat:@"image_%d.png", 1];

The program will say that "image_1.png" is unused.  So be carful when the file name has a numeric suffix.

No comments:

Post a Comment