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.
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.
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
1. The resemblance between the GCC compiler and the kernel in Linux
All articles are property of their respective authors. Please read our Privacy Policy!
© 2009 ArticleInput.com.
Partners: Damenmode