I have started to use the FIXME
, TODO
, ???
and !!!
tags in XCode but have am finding it painful that it does not recognise th
Edited 2016-02-02
Xcode now supports //MARK:, //TODO: and //FIXME: landmarks to annotate your code and lists them in the jump bar.
To find those special markups (and actually any markups you specify yourself), you can use the search navigator, enter the following string and then choose "In Project, matching regex "...", ignore case":
(//FIXME|//!!!|//\?\?\?|//TODO)
This will search your project for all those special markups. You can even add any markup you would like to, e.g. "//REVIEW: please review the following code". This would then be the following search string:
(//FIXME|//!!!|//\?\?\?|//TODO|//REVIEW)
I created a tab in my workspace which has the search navigator always open, filled with this string. Unfortunately, XCode will sometimes remove this string from the searchbox, so you have to have it copy&paste ready whenever you need it.
In xcode 4.1 (don't know if this works in previous versions) I write
#warning TODO: fix this later...
to get a compile warning or
#error FIXME: fix now!
to get a compile error.
I also add these to the code snippet library to make it really ease to add todos.
how about this Xcode plugin? --> https://github.com/trawor/XToDo
A workaround is to use a build script which marks those as warnings:
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/"
Credit to Benjamin Ragheb.
If you want to continue developing but need to ensure your app doesn't get released with a leftover //FIXME:
you can do the following as an alternative.
Define this somewhere in one of your headers:
#if DEBUG
#define FIXME 0;
#endif
This definition lets your app build for debug but prevents it from being archived for release.
Now you can use FIXME
anywhere you would've used the comment.
Ex: NSNumber *magicNumber = 7; FIXME
xCode 6 beta 4 should support MARK, TODO and FIXME landmarks.
Xcode now supports //MARK:, //TODO: and //FIXME landmarks to annotate your code and lists them in the jump bar. (14768427)!