dre*_*ewh 15 xcode cocoa objective-c
我有一个有点混乱格式的Objective-C代码库.有没有办法让Xcode重新格式化整个项目以符合编码标准(即正确缩进,空格v.制表符等)?还有其他工具可以实现这一目标吗?
一个简单但有限的解决方案是Xcode中的Edit-> Format-> Re-Indent,它将应用您当前的缩进设置(Xcode-> Preferences ... - > Indentation).
此外,工具缩进可能对您有所帮助.它的目标是普通C,但有很多选择可以帮助.我不知道它是否默认出现在OS X上.
NAME
indent - changes the appearance of a C program by inserting or deleting
whitespace.
SYNOPSIS
indent [options] [input-files]
indent [options] [single-input-file] [-o output-file]
indent --version
DESCRIPTION
This man page is generated from the file indent.texinfo. This is Ediâ
tion of "The indent Manual", for Indent Version , last updated .
The indent program can be used to make code easier to read. It can
also convert from one style of writing C to another.
indent understands a substantial amount about the syntax of C, but it
also attempts to cope with incomplete and misformed syntax.
Run Code Online (Sandbox Code Playgroud)
来自Xcode:
1)更改缩进首选项以匹配您想要的.
2)选择要处理的文件并选择全部(cmd-A)
3)向左移动(cmd- [)几次,直到所有线都位于窗口的左边缘.
4)使用重新缩进选择(从编辑 - >格式 - >或右键单击上下文菜单)
一次只能处理一个文件,而不是整个项目.也只处理缩进.
| 归档时间: |
|
| 查看次数: |
7928 次 |
| 最近记录: |