Essentials about Xcode and its features


Using alternate templates with Xcode

When you're creating a new program in Xcode, you always have the option to select among several templates, each of which gives you a different basis for your code. Besides a Window-Based Application, you can create a project as a View-Based Application, a Tab Bar Application, a Navigation-Based Application, a Utility Application, or an OpenGL ES Application. Most of these templates build in view controllers and give access to other functionality. I give you a glance at them all now so you can see the possibilities that Xcode offers.

Xcode tips and tricks

Before we leave Xcode behind, explore a few of the great features it includes to make your coding easier. You can investigate these features in any of the projects that you've written so far. You see a file's code in an editing window whenever you single-click a .h or .m file. If this window isn't big enough, you can instead double-click to get a brand-new window. The editing window includes a number of nice features:

Autocompletion - Whenever you write code in the editing window, Xcode tries to autocomplete words for you. This includes framework methods, your own methods, and even variable names. For methods, it goes a step further and shows you the standard arguments you should pass. If you don't like what you see, keep typing; but if you do like it, press the Tab key, and the rest will be inserted. We've torn out our hair way too many times due to misbehaving code that turned out to be the result of a typo. Xcode's autocompletion can easily resolve that problem - in advance.

Class controls - Ctrl-click the class name in an @implementation line, and you'll see a Refactor option. Select this option to not only change the name of your class in all files but also modify the names of the files for that class. Also see variable controls for a similar feature.

Code folding - As with many modern IDE environments, you can fold your code, making it easier to read by hiding the contents of functions and/or comments. You can easily fold a function by clicking in the narrow gray bar to the left of your code. The functionality is also available in the View menu or by Ctrlclicking inside the editing window.

Doc lookup - Option-double-click any standard structure, method, or property, and you'll see information on it in an Xcode Workspace Guide window (which we discuss more in a moment). We think this is the best feature of the IDE, because it makes programming with otherwise unknown frameworks simple.

Superclass lookup - At the top of the editing window is a menu labeled C. You can use this window to look up the superclass of your current object. Doing so leads you to the superclass's header file, which reveals its properties and methods.

Variable controls - Click a variable, and you see a gray underline materialize; shortly after that, you see a triangle appear to the right, allowing you to pull down a menu. From there, you can jump straight to the definition of the variable or Edit All in Scope. This allows you to change the name of a variable within your current scope. Also see class controls for a similar feature.

You call up the Organizer window by choosing Window > Organizer. You can store references to a number of projects here, linking them in from the + menu that appears at the bottom of the window. In addition to easily accessing your projects, you can compile them in a variety of configurations and even see debugging logs and crash logs related to them.

Legal Disclaimer

Our website is not responsible for the information contained by this article. Articleinput.com is a free articles resource thus practically any visitor can submit an article. However if you notice any copyrighted material, please contact us and we will remove the article(s) in discussion right away.

Note: This article was sent to us by: Marvin V. Hayels at 09232010

Related Articles

1. The resemblance between the GCC compiler and the kernel in Linux
The GNU Compiler Collection The GCC compiler, like the kernel, is designed for portability. Like all open source programs, GCC is available in source form, and ...

2. Automake and Autoconf discover the state of the target environment
Automake/Autoconf Open source software is designed to be distributed in source code form so that it can be compiled for the target platform. When target platfor...

3. How and where does a software developer get help
Where to Get Help All software developers depend on little helpers, whether visible or invisible. Open Source developers tend to call upon a large number of res...

4. Necessary additional steps to get Linux running
Host Services After the software is installed, some additional configuration steps are necessary to get the packages in running order. This part goes through co...

5. Virtualization and the computer resource sharing
Target Emulation and Virtual Machines Virtualization is a mature technology that lets several operating systems share the physical resources of a machine, such ...

6. Development of hosting code and use of virtualization software
Virtualization Software for x86 Hosts If you're developing code for an x86 host, why bother using virtualization? The host and target are identical, so using vi...

7. How to boot the board and start Linux
What to Do After Unpacking the Board The best way to assess what is supplied with the board is to plug in the board and get Linux up and runnin...

8. Root file system and kernel as parts of a Linux system
Understand the RFS The kernel is only one part of a Linux system. The root file system is a necessary component for a running system and is frequently overlooke...