Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does XCode 4 Support Regions & What are your methods for code management?

Im aware that Xcode 3 never supported Regions, But im unsure if Xcode 4 does, wondering if anyone knew.

Regions are helpful for ordering code and keeping it clean and manageable, they're supported in .NET C# IDEs and are usually accessable using #region and #endregion (If i recall correctly).

If not, is there any other way for managing code?
Any Tips, Techniques, or advice would be fantastic!

Oliver.

like image 848
Ospho Avatar asked Mar 31 '11 07:03

Ospho


People also ask

How to add localization in XCode?

Add LocalizationsIn the project editor, select the project name under Project, and click Info. Under Localizations, click the Add button (+), then choose a language and region combination from the pop-up menu.

What programming language does XCode use?

Xcode supports source code for the programming languages: C, C++, Objective-C, Objective-C++, Java, AppleScript, Python, Ruby, ResEdit (Rez), and Swift, with a variety of programming models, including but not limited to Cocoa, Carbon, and Java.

How do I build in XCode?

Launch Xcode, then click “Create a new Xcode project” in the Welcome to Xcode window or choose File > New > Project. In the sheet that appears, select the target operating system or platform and a template under Application. In the following sheets, fill out the forms and choose options to configure your project.


Video Answer


1 Answers

Xcode (both 3 & 4) does support code folding - that is, the ability to visually collapse a section of code into one line - but it's based on blocks defined by the syntax of the code itself, not on specially-marked regions. So you can collapse classes, methods, loops, if blocks, etc. Look to the left of your code, at the vertical stripe that appears in various shades of gray. Mousing over that stripe will highlight a section of code; clicking will then fold that section.

Xcode's 4's "symbol navigator" pane also offers a tree view of your project that displays classes, methods, properties, and instance variables hierarchically.

You can also use (in both 3 & 4) #pragma mark SectionName to add section markers to the symbol list that appears at the top of editor windows.

like image 82
Sherm Pendley Avatar answered Nov 15 '22 08:11

Sherm Pendley