1

我的课堂上有大约两千行代码,里面有近五十个方法。我知道我可以将它们分开#pragma mark SomeMethodsSet并看到上面跳转栏中列出的内容,但是有没有办法将每个集合折叠在一起,就像我可以使用单一方法一样?

4

3 回答 3

4

Command + Option + Shift + 左箭头 - 折叠所有方法 Command + Option + Shift + 右箭头 - 展开所有方法

于 2012-11-18T09:54:57.690 回答
1

If you hover your mouse between the place where you set a breakpoint, and the place where you write the code, you'll see an arrow pointing down. Clicking on it will hide the code.

Before:

enter image description here

After:

enter image description here

于 2012-11-18T09:19:05.263 回答
0

您可以使用一些 Xcode 跳转栏魔术来更好地浏览您的代码 -> http://mobiledevelopertips.com/xcode/xcode-4-jump-bar-tips-and-tricks.html

如果您发现自己在处理大型类和大量方法时遇到困难,为什么不尝试重构代码呢?将一个大类分成几个较小的类。将一些逻辑提取到新类中。尽量减少班级规模,让他们一次只做几件事。避免尝试一次解决所有问题的“神级”。

于 2012-11-18T10:11:33.380 回答