目标C整洁 [英] Objective-C Tidy
问题描述
我有一个有点乱码格式化的Objective-C代码库。有没有办法让Xcode重新格式化整个项目以符合编码标准(即,正确缩进,空格v。制表符等)?是否有其他工具可以实现这一点?
I have a somewhat messily-formatted Objective-C code base. Is there a way to have Xcode reformat an entire project to conform to a coding standard (i.e., properly indent, spaces v. tabs, etc.)? Are there other tools that might accomplish this?
推荐答案
Uncrustify: http://uncrustify.sourceforge.net/
Uncrustify: http://uncrustify.sourceforge.net/
C代码美化,C ++,C#,ObjectiveC,D,Java,Pawn和VALA
Source Code Beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA
如果你想要更简单的东西,在;
{
上添加新的换行符, code>} ,并手动重新缩进代码。它不会在任何地方接近完美布局的代码,重新缩进可能是一个痛苦的大代码,但它将是一致的。
If you want something simpler, you could probably get some way by simply stripping out all the white-space/line-breaks, and adding a new line-break on ;
{
}
, and manually re-indenting the code. It won't be anywhere near perfectly laid out code, and reindenting could be a pain on large code, but it will be consistent.
这篇关于目标C整洁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!