OGeek|极客世界-中国程序员成长平台

标题: iphone - 折叠部分代码(变量声明和 if block ) [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 22:07
标题: iphone - 折叠部分代码(变量声明和 if block )

有没有什么方法可以在 Xcode 4.2 中折叠我的部分代码?我不是要求折叠方法和语句 block ,因为 XCode 已经支持它。

编辑:我有 100 行代码,其中包含变量、数学运算、if 语句、switch block 等。我想将这些行折叠在一起。



Best Answer-推荐答案


I have 100 lines of code that contain vars, math operations, if statements, switch blocks, etc ... I want to fold these lines together.

对于 if 语句和 block ,您可以按照 How to collapse all methods in XCode? 处的说明进行操作.

如果您使用的是 Objective C,那么您可以使用 #pragma 标记 来检测您的代码,它将是可折叠的。 #pragma mark 很像 Visual Studio #region。见 Can you set code regions in Xcode?了解更多详情。

关于iphone - 折叠部分代码(变量声明和 if block ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9715901/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4