在XCode4中显示TODO FIXME等标记
来源:互联网 发布:淘宝发货单打印软件 编辑:程序博客网 时间:2024/06/05 07:31
在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:
Instructions
- 进入项目属性设置那个页面
- 选择一个Target
- 选择Build Phases标签
- 点击右下角的Add Build Phase
- 展看上面刚出现那一栏Run Script,输入以下内容
- Head over to your project's item in the Project Navigator (usually at the very top)
- Find your target in the list of targets on the left, select it
- Head over to the "Build Phases" tab.
- Click the "Add Build Phase" in the bottom right of this screen.
- In the editor that appears insert the bash script shown below.
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.
Bash Script For "Run Script" Build Phase
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/"
You'll also be able to click on each of the warnings in the issue navigator to go right to the file and point in your code where you left the original
//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里面显示, 在编译后的警告里面也会有提示!
- 在XCode4中显示TODO FIXME等标记
- 在Xcode4中显示TODO: FIXME:等标记
- 在Xcode4中显示TODO: FIXME:等标记
- 在XCode 4中使用TODO FIXME等标记
- 在XCode中使用TODO FIXME等标记
- 在XCode中使用TODO FIXME等标记
- Xcode MARK TODO FIXME 标记
- Xcode TODO MARK FIXME 标记
- xcode中查看 TODO, FIXME, 自定义标签等警告
- eclipse中的任务标记(TODO、FIXME、XXX)
- eclipse中的任务标记(TODO、FIXME、XXX)
- TODO和FIXME
- Qt TODO/FIXME 功能
- TODO FIXME XXX
- eclipse //TODO //FIXME //XXX
- 代码中 TODO FIXME XXX 注释的特殊含义
- Eclipse中Java代码注释XXX、TODO、FIXME的意义
- 源码中TODO、FIXME和XXX的含义
- shell脚本中用expect实现远程scp文件
- qsort排序总结
- ADO.NET实用经验
- CMake初步(2)
- wpf简单的音乐播放
- 在XCode4中显示TODO FIXME等标记
- GMT和UTC
- iframe 在ie下面总是弹出新窗口解决方法
- Microsoft Jet 数据库引擎找不到对象'Sheet1$A:CV'
- MVC FCKEditor和CKEditor的使用
- gridview----删除
- C# 复制类内容
- 课后习题
- 监听连接