views:

516

answers:

3

When writing c#, in Visual Studio, you can set regions to group code accordingly. Being new to Xcode I can't seem to find a similar feature.

+5  A: 

Using Xcode editor, you can collapse or expand any block of code by clicking in the little left margin. Moreover, you can put a mark in any point in the code with:

#pragma mark your title as long as you want

Your mark will then appear in the middle popup menu on top of the editor window.


Update: I have found that a duplicate of this question exists here. The answers may be of interest.

mouviciel
That is similar, but not quite the same. Regions have start and end points you can also collapse and expand.
Ferdeen
the #pragma mark doesn't seem to do the same thing. But it's better than nothing. Thanks.
Ferdeen
Yes, since Xcode does not implement #region, I've tried to find something similar.
mouviciel
+3  A: 
Brock Woolf
no need to be pragmatic I need to know what's right. Thanks and thanks for the screen shot.
Ferdeen
sure no problem :P
Brock Woolf
+4  A: 

You can also use:

// MARK: -

or

// MARK: Initialization

which is more portable than #pragma mark.

0xced