In XCode Is there any way to get a list of the TODOs or FIXMEs you might have placed into comments other than scanning through the function list on each file individually? I'm used to doing work on Eclipse where it kept a task list of those kinds of comments, plus you could configure special tags for other situations. If doing TODOs and FIXMEs are not the desirable solution to noting such issues - what process do you guys do to keep track of the loose ends that need to be tied up later?
Page 1 of 1
XCode TODO's and FIXME's
#2
Posted 09 February 2011 - 10:51 PM
Found a nice solution after Googling around for a bit:
1.) Go to: Project -> New Build Phase -> New Run Script Build Phase
2.) In the window that pops up place this in the script section:
Make sure you don't have any spaces in your path (my projects folder had a space and it broke the find). What this script does is look for any TODO: or FIXME: comments in your code and flags them as a warning whenever you build your project. Then you can click on those warnings and get to the file in question. This will save time in trying to find these little comments that I've peppered around the place. Maybe someone else will find it useful.
If you want to remove the script just expand your Targets list, choose the Run Script option and delete it or modify it as necessary. If you're OCD and hate to have warnings in your build results and you use FIXMEs/TODOs then this script might be annoying. Or maybe thats the point. *shrug*
--Tim
1.) Go to: Project -> New Build Phase -> New Run Script Build Phase
2.) In the window that pops up place this in the script section:
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:"
find ${SRCROOT} \( -name "*.h" -or -name "*.m" \) -print0 | \
xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | \
perl -p -e "s/($KEYWORDS)/ warning: \$1/"
Make sure you don't have any spaces in your path (my projects folder had a space and it broke the find). What this script does is look for any TODO: or FIXME: comments in your code and flags them as a warning whenever you build your project. Then you can click on those warnings and get to the file in question. This will save time in trying to find these little comments that I've peppered around the place. Maybe someone else will find it useful.
If you want to remove the script just expand your Targets list, choose the Run Script option and delete it or modify it as necessary. If you're OCD and hate to have warnings in your build results and you use FIXMEs/TODOs then this script might be annoying. Or maybe thats the point. *shrug*
--Tim
#3
Posted 10 February 2011 - 06:02 AM
Thanks for the advice. I think there is also another way of doing this where the fixme is implemented using pragma marks which show up in that list of methods, defines, pragma marks etc. that you can browse per file. I'm sorry, I don't know what it's called. Probably less easy to find in big projects but also less annoying?!
#4
Posted 10 February 2011 - 08:27 AM
Quote
I think there is also another way of doing this where the fixme is implemented using pragma marks which show up in that list of methods, defines, pragma marks etc.
Yeah, just use a normal comment like // TODO: or // FIXME: and it'll show up in the function list, but like you say, when the project size increases and you're working towards playable rather than complete - there's bound to be a number of places that need to be worked on and clicking on each file to find these comments is tedious. In my case I also use my TODO list as a mental notebook of future features. I could keep track of that stuff in something like Evernote but what I don't need is one more app to fiddle with and organize.
#5
Posted 14 April 2012 - 03:22 AM
Tim, on 09 February 2011 - 10:51 PM, said:
1.) Go to: Project -> New Build Phase -> New Run Script Build Phase
2.) In the window that pops up place this in the script section:
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:"
find ${SRCROOT} \( -name "*.h" -or -name "*.m" \) -print0 | \
xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | \
perl -p -e "s/($KEYWORDS)/ warning: \$1/"
Super! Thanks Tim, this works like a charm!
#7
Posted 4 weeks ago
This does work a treat. Thanks for the tip!
If you're using box2d you might want to extend the regex so it will search .m and .mm files:
If you're using box2d you might want to extend the regex so it will search .m and .mm files:
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:"
find ${SRCROOT} \( -name "*.h" -or -name "*.m" -or -name "*.mm" \) -print0 | \
xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | \
perl -p -e "s/($KEYWORDS)/ warning: \$1/"
Share this topic:
Page 1 of 1

Help













