Analyze project to find missing or unreferenced files
Analyze project to find missing or unreferenced files
- Subject: Analyze project to find missing or unreferenced files
- From: Dave Keck <email@hidden>
- Date: Mon, 15 Mar 2010 06:47:15 -1000
Hey list,
Working on a handful of projects I have lots of generic Obj-C
categories that are shared between them, and often when changing one
project, I forget to reflect those changes in another. Frequently this
leads to run-time errors ("unrecognized selector sent to instance...")
because a category wasn't included in the object file.
To address this I wrote a script to analyze one's Xcode project to
find either (a) files that are referenced (#imported somewhere) but
don't actually exist in the project, or (b) files that exist in the
project but aren't referenced anywhere. This script can help prevent
the mentioned run-time errors, and can help rid your project of old
source files that are no longer needed.
http://themha.com/analyze_project.py
This script isn't super-intelligent. First, it doesn't search nib
files, so if that's the only place a class is referenced, then it will
appear to the script as unreferenced. Second, categories without
corresponding header files will appear to be unreferenced. (That is,
if you have a class MyClass that's implemented via MyClass.m and
MyClass+Extras.m, the latter will appear unreferenced, unless there's
a MyClass+Extras.h that's imported somewhere.)
Set up is easy:
Scripts menu > Edit User Scripts...
+ New Shell Script
Paste script contents
Output: Display in Alert
Errors: Display in Alert
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden