随着大量的Xcode新手的涌入,我相信会有很多Xcode的技巧和技巧可以分享。

你的呢?


当前回答

我不知道是否每个人都知道这一点,但当我了解到我可以使用“代码折叠”并通过单击想要折叠的代码附近的灰色区域来隐藏我不想查看的嵌套函数时,我很高兴。

很难解释……

其他回答

Cmd + Ctrl + up / down折叠或展开所有函数。

当您在一个方法上使用代码完成,并且它有多个参数时,使用CTRL + /移动到下一个需要填充的参数。

没有多少键盘快捷键,但是源代码中的TODO注释显示在编辑器顶部的方法/函数下拉列表中。

例如:

// TODO: Some task that needs to be done.

在方法和函数的下拉列表中显示,以便您可以直接跳转到它。

大多数Java ide在滚动条中为这些任务标记显示一个标记,这样更好,但这也可以工作。

通过命令行控制Xcode的文本编辑器:xed

> xed -x                # open a new untitled document
> xed -xc foo.txt       # create foo.txt and open it
> xed -l 2000 foo.txt   # open foo.txt and go to line 2000

# set Xcode to be your EDITOR for command line tools
# e.g. for subversion commit
> echo 'export EDITOR="xed -wcx"' >> ~/.profile

> man xed               # there's a man page, too

使用xcodebuild命令行在共享构建机器上进行干净的构建:

cd project_directory
xcodebuild -configuration Release -alltargets clean
xcodebuild -configuration Release -alltargets