Xcode 中的 TODO:如何让它们脱颖而出?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9469412/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 23:27:38  来源:igfitidea点击:

TODOs in Xcode: How to make them stand out?

xcodecommentstodo

提问by Tustin2121

I am aware of the method of making them warnings, but I want to keep my legit warnings separate from my todos. I'm also have yet to see xcode 4 highlight the todos like everyone seems to think it does.And xcode's todo support only works on todos outside of functions...

我知道向它们发出警告的方法,但我想将我的合法警告与我的待办事项分开。我还没有看到 xcode 4 像每个人似乎都认为的那样突出显示待办事项。并且 xcode 的 todo 支持仅适用于函数之外的 todos...

The build phase script that is outlined hereis wonderful, but it makes the TODOs into warnings, and Objective C creates enough legitimate warnings that I don't want my todo's clogging up the list. Is there a way to make the todo's a differentbuild result, like an info result or something? Something that will not make Xcode's realwarnings (half of should beerrors) vanish in the crowd?

此处概述的构建阶段脚本很棒,但它使 TODO 变成了警告,Objective C 创建了足够多的合法警告,我不希望我的 todo 阻塞列表。有没有办法让待办事项成为不同的构建结果,比如信息结果或其他什么?不会让 Xcode 的真正警告(一半应该是错误)在人群中消失的东西?

回答by Richard Stelling

UPDATE

更新

As of Xcode 4.4; FIXME:, ???:, ????:, !!!:all work outside of a function/method.

从 Xcode 4.4 开始;FIXME:, ???:, ????:,!!!:都在函数/方法之外工作。

ORIGINAL ANSWER (< Xcode 4.4)

原始答案(< Xcode 4.4)

xcodewill highlight a TODObut only outside of a function.

xcode将突出显示TODO但仅在函数外部。

//TODO: This will show in function drop down 
-(void)method1
{
    //TODO: This will not show
}

In addition; FIXME, ???, ????, !!!!do the same.

此外; FIXME, ???, ????,!!!!做同样的事情。

TODO

去做

回答by Caleb

One way is to use Xcode's search feature. If you mark your code with // TODO:..., you can search the entire project for // TODOand generate a nice list of tasks.

一种方法是使用 Xcode 的搜索功能。如果你用 标记你的代码// TODO:...,你可以在整个项目中搜索// TODO并生成一个很好的任务列表。

Also, note that comments starting with // TODO:or // FIXME:that are outside the scope of any method will appear in the method popup menu, just like #pragma marklines.

另请注意,以// TODO:或开头的注释// FIXME:将出现在方法弹出菜单中,就像#pragma mark行一样。