Interface Builder is a graphical development environment integrally tied in to Xcode. Whenever you write an Xcode project, it includes a .xib file that contains Interface Builder definitions for where graphical objects are placed. Each of the different Xcode templates comes with different objects prebuilt this way. Some of them have multiple, linked .xib files, with one file representing each separate screen of information. For now, be aware that Xcode and Interface Builder are designed to go together. Let's look at what's inside Interface Builder and then quickly look at how to mock up Interface Builder objects.
You usually access Interface Builder by double-clicking a .xib file in your project. The default .xib file is generally called MainWindow.xib. Clicking it brings up the file in Interface Builder, showing how default objects have been designed.
You'll see talk of both .xib files and nib files. They're pretty much the same thing: a nib file is a compiled .xib file. They appear as .xib files in Xcode, but some methods call them nib files. Apple documents refer to a nib document window in Interface Builder; we've done the same here.
When you call up Interface Builder, you initially see three windows: the nib document window, the main display window, and the Library window. The fourth important window - the inspector window - doesn't appear by default, but you'll call it up pretty quickly.
The nib document window displays top-level objects, which are objects without a parent. A default MainWindow.xib file includes four such objects. The window object is the one real object here; you can play with it in Interface Builder and also link it out to Xcode. As you'd expect, this is the window object that was created by default in the templates you've used so far.
The other three top-level objects are all proxies, which means they're placeholders for objects not contained in Interface Builder. Generally, you can only see objects in Interface Builder that were created there; if you need to access something else in Interface Builder, you do so by creating a proxy. The Webimage App Delegate is a proxy for the app delegate object. File's Owner refers to the object that manages the .xib file (usually either the application or a view controller), and First Responder refers to the top object in the responder chain. You'll meet these proxies again when we touch on IBOutlets.
The main display window shows what the .xib file currently looks like. Because we used the Window-Based Application template in Xcode, there's nothing here yet. If we'd used one of the other templates, you'd see tab bars or other prebuilt elements. In any case, this is where you arrange your user interface elements as you create them. Together, the nib document and main display windows contain all the objects understood by Interface Builder.
The Library window is where you can find all the UI elements you may want to add to your program. You can start exploring the library with a little mousing. Click the Library and Cocoa Touch Plugin toggles, and you'll see four main classes of UI elements:
The inspector window gives you access to a wide variety of information about an object and lets you change it; but it may or may not open automatically. If it isn't visible, you can call up the inspector by choosing Tools > Inspector. Afterward, whenever you click an object, its data will appear in the inspector. By default, the inspector window has four tabs: Attributes, Connections, Size, and Identity.
Our website is not responsible for the information contained by this article. Webworldarticles.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.
This article was sent to us by:
Christian Glousten at
09232010
1. Market segmentation is a necessity when selling an iPhone iPad app
All articles in this directory are property of their respective authors. Additionally, read our Privacy Policy
© 2010 WebWorldarticles.com - All Rights Reserved. Partners: Gunblade Saga