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

你的呢?


当前回答

你可以让Xcode在Info上运行预处理器。plist文件:

        <key>CFBundleShortVersionString</key>
    #ifdef DEBUG
        <string>1.0 (debug)</string>
    #else
        <string>1.0</string>
    #endif

详情见http://developer.apple.com/technotes/tn2007/tn2175.html。

其他回答

对我来说,它一直是:Command⌘+ 0:

在你调试或运行之后,如果你退出iPhone模拟器或调试应用,你会留下调试器窗口。

当你使用“单窗口布局”时,回到编辑器必须点击工具栏,这很烦人(加上你以后需要“删除细节窗格”)。

上面的快捷方式做到了这一点,并让您准备好编写代码。

Xcode中的类浏览器!通过按shift +⌘+ c实现。您可以缩小范围,仅显示您的活动项目。只要您只想浏览类层次结构,它就会为您提供一个不那么混乱的视图。

获取Colin Wheeler的完整Xcode键盘快捷键列表(PDF或PNG格式)。把它打印出来,放在显眼的地方(我把它贴在屏幕旁边的墙上)。

编辑: Xcode 3.2的更新版本

编辑2: Xcode 4的更新版本

通过命令行控制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

⌘-[和⌘-]缩进和取消所选文本。使清理源代码更加容易。