在XCode 3,我们可以用类似这样的注释来方便我们标记需要修改的部分:
// TODO:
// FIXME:
// !!!:
// ???:
XCode 4不支持这一功能了,网上有一种解决方法, 转发过来:
原文: http://deallocatedobjects.com/posts/show-todos-and-fixmes-as-warnings-in-xcode-4
Here's a neat little snippet for Xcode 4 that will cause all of your //TODO:
and//FIXME:
comments in your code to appear as compiler warnings when you build. Here's how to use it:
Now just build and you'll see all your //TODO:
and //FIXME:
comments have become warnings. I love this technique, it might not be right for everyone, but hope it helps someone.
KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:" find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\{1}quot; | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
//TODO:
or
//FIXME:
Extra pro tip: Make sure you're using phrases to describe your //TODO:
comments like//TODO: Handle this error gracefully
, and things like that. The phrases will show up in the issues list beside each warning.
这样就可以在Document Item里面显示, 在编译后的警告里面也会有提示!