29 December, 2009

About Interface Builder.

Interface Builder:
This is a visual design tool you use to create the user interface of your iPhone OS and Mac OS X apps.
Responsibility:


  1. Arrange items that are required(choose from library).
  2. Set their attributes.
  3. Establish connections between them.
  4. Save then in special type of resource files(nib files).
NIB / XIB:
NIB :
NextSTEP Interface Builder(in binary format).

XIB : XCode Interface Builder(in XML format).
A nib / xib file stores your objects, including their configuration and layout information, in a format that at runtime they can be used to recreate the actual objects.
Difference between XIB and NIB : Both formats store the same information but do so in different ways.
Xib files: These are intermediate XML-based files that are intended for use only during the development of your project.Because they are text based, you can save them in your source code management system and perform diff on them.
NIB files: During deployment, xib files are converted into nib files, which contain a binary version of the document data and are what your application actually loads at runtime.


Windows in Interface Builder:
Interface builder provides several windows to allow you to display and modify the objects in your user interface.


  1. Document Window.
  2. Library Window.
  3. Inspector Window.
  4. Connection Panel.
Document Window: Each Interface builder document stores information about one or more objects you want to create at runtime in your application. 
Library Window: This contains the object that you can add to your Interface Builder documents.


It has three modes


  1. Object Mode: When this mode selected, the window displays the objects you use to build your user interface.Ex:Windows, menus, views, controls etc.
  2. Classes Mode: This window displays the classes you can use to build the user interface in your object. Ex: Custom classes.
  3. Media Mode: This window displays the image and sound resources you can refer to from your object. 


Inspector Window: This makes it easy to display and adjust the settings for the currently selected objects.This is divided into panes:
Attributes: Displays the object specific configuration attributes.For Cocoa and Cocoa touch objects, the sections in this pane reflect the classes in the inheritance hierarchy of the selected object.
Effects: Displays the core animation based and Core Graphics based attributes associated with the object.
Size: Displays information about the size and position of the object and also displays  alignment controls and autosizing attributes.
Bindings: DIsplays the available bindings for an object and provides an interface for binding those objects to one or more controllers.
Connections: Displays the outlets and actions of the objects along with information about which ones are currently connected to other objects.
Identity: Displays information that helps identify the objects either at design time or runtime.
Connection Panel: A connection is a way to associate interface elements with source code.There are few sections their description goes as follows
Outlets: Lists the outlets exposed by the object. An outlet is a member variable of the class that has the IBOutlet keyword associated with it. Outlets let you create inter-object reference from within Interface builder.
Sent Actions: Shows the target of a control's action message. An action is a message that is sent by a control in response to a user action.
Received Actions: Lists  the incoming actions that the current object is capable of handling.
Accessibility: Lists standerd outlets for storing accessibility related information. These outlets are present for all visual elements.
Accessibility Reference: Lists the source objects that refer directly to the selected object through an accessibility connections.
Reference Outlets: Lists the source objects that currently refer to this object through an outlet.


iPhone OS interface objects:
windows: A typical iPhone application has only one window, which provides the backdrop for all of the applications content.
Views and Controls: In iPhone OS, everything that appears onscreen descends from the UIView class. In practical terms, views and controls are rectangular regions that display data and are capable of handling events.
Custom View: Interface builder is aware of any custom views declared in your source code. You can find your custom views listed in the classes tab of the library window.
Toolbars: Toolbar contains a collection of buttons representing frequently used commands in an application.
Controller Objects: In addition to visual objects, Cocoa touch nib files can include any type of custom object needed by application. This is to facilitate MVC design pattern used by iPhone application. The non visual objects in a nib files acts as controllers for the visual objects
Controls and custom objects in Cocoa touch nib files:


  1. NSObject.
  2. ViewControllers.
  3. Proxy Object.





No comments:

Post a Comment