Professional Documents
Culture Documents
adds Smalltalk-style messaging to the C programming language. Today, it is used primarily on Apple's Mac OS X and iOS: two environments based on the Open Step standard, though not compliant with it.[1] Objective-C is the primary language used for Apple's Cocoa API, and it was originally the main language on NeXT's Next STEP OS. Generic Objective-C programs that do not use these libraries can also be compiled for any system supported by gcc or Clang. Objective-C was created primarily by Brad Cox and Tom Love in the early 1980s at their company Step stone. Both had been introduced to Smalltalk while at ITT Corporation's Programming Technology Center in 1981. The earliest work on Objective C traces back to around that time. Objective-C is a thin layer on top of C, and moreover is a strict superset of C; it is possible to compile any C program with an Objective-C compiler, and to freely include C code within an Objective-C class. The Objective-C model of object-oriented programming is based on message passing to object instances. In Objective-C one does not call a method; one sends a message. This is unlike the Simula-style programming model used by C++. The difference between these two concepts is in how the code referenced by the method or message name is executed. In a Simula-style language, the method name is in most cases bound to a section of code in the target class by the compiler. In Smalltalk and Objective-C, the target of a message is resolved at runtime, with the receiving object itself interpreting the message. Objective-C was extended at NeXT to introduce the concept of multiple inheritance of specification, but not implementation, through the introduction of protocols. This is a pattern achievable either as an abstract multiply inherited base class in C++, or as an "interface" (as in Java and C#). ObjectiveC makes use of ad hoc protocols called informal protocols and compiler-enforced protocols called formal protocols. Objective-C, like Smalltalk, can use dynamic typing: an object can be sent a message that is not specified in its interface. This can allow for increased flexibility, as it allows an object to "capture" a message and send the message to a different object that can respond to the message appropriately, or likewise send the message on to another object. This behavior is known as message forwarding or delegation (see below). Alternatively, an error handler can be used in case the message cannot be forwarded. If an object does not forward a message, respond to it, or handle an error, the message is silently discarded. If messages are sent to nil (the null object pointer), they will be silently ignored or raise a generic exception, depending on compiler options.
Other features.
Objective-C's features often allow for flexible, and often easy, solutions to programming issues. Delegating methods to other objects and remote invocation can be easily implemented using categories and message forwarding. Swizzling of the isa pointer allows for classes to change at runtime. Typically used for debugging where freed objects are swizzled into zombie objects whose only purpose is to report an error when someone calls them. Swizzling was also used in Enterprise Objects Framework to create database faults. Swizzling is used today by Apples Foundation Framework to implement Key-Value Observing. Serialization, commonly called Archiving in Objective-C, can be done by overriding read and write methods.
Xcode IDE as a development tool- Xcode is the complete toolset for building Mac
OS X and iOS applications and with Xcode 4, the tools have been redesigned to be faster, easier to use, and more helpful than ever before. The Xcode IDE understands your projects every detail, identifies mistakes in both syntax and logic, and will even fix your code for you. Quite simply, Xcode 4 will help you write better code. Xcode 4 has a brand new user interface, built upon proven technologies that Apple itself uses to build Mac OS X and iOS, and that have produced over a quarter million Mac OS X and iOS apps.
Single Window- As an experienced Xcode user, the first thing you will notice about Xcode 4
is that the many windows used to perform the development tasks you work on every day have been consolidated into a single window. The Xcode 4 work area has several unique UI elements that make it easy to work on many different tasks, even multiple projects, without cluttering your work area. Your editor is always front and center.
Instruments for Xcode 4- Instruments has a streamlined interface, complete with the
new Jump Bar, and stack compression from Xcode 4s UI. Using Xcode4s new launch schemes, it is easier than ever to create a robust test harness to run your app in Instruments. That includes launching Instruments in deferred mode, keeping the data collection UI off screen and saving system resources for running and metering your application.
The iOS Developer Center -The iOS Developer Center, Programme and SDKiOS (known as iPhone OS before June 2010) is Apple's mobile operating system. Originally developed for the iPhone, it has since been extended to support other Apple devices such as the iPod touch, iPad and Apple TV. Apple does not license iOS for installation on third-party hardware. The user interface of iOS is based on the concept of direct manipulation, using multitouch gestures. Interface control elements consist of sliders, switches, and buttons. The response to user input is immediate and provides a fluid interface. Interaction with the OS includes gestures such as swipe, tap, pinch, and reverse pinch, all of which have specific definitions within the context of the iOS operating system and its multytouch interface. Internal accelerometers are used by some applications to respond to shaking the device (one common result is the undo command) or rotating it in three dimensions (one common result is switching from portrait to landscape mode).iOS is derived from Mac OS X, with which it shares the Darwin foundation, and is therefore a Unix-like operating system by nature. In iOS, there are four abstraction layers: the Core OS layer, the Core Services layer, the Media layer, and the Cocoa Touch layer. The current version of the operating system (4.3.3) uses roughly 660 megabytes of the device's storage, varying for each model.[4]
History-
The operating system was unveiled with the iPhone at the Macworld Conference & Expo on January 9, 2007, and released in June of that year.[5] At first, Apple marketing literature did not specify a separate name for the operating system, stating simply that the "iPhone runs OS X".[6]Initially, third-party applications were not supported. Steve Jobs argued that developers could build web applications that "would behave like native apps on the iPhone".[7][8] On October 17, 2007, Apple announced that a native Software Development Kit (SDK) was under development and that they planned to put it "in developers' hands in February".[9] On March 6, 2008, Apple released the first beta, along with a new name for the operating system: "iPhone OS".
User Interface Tools- In general, user interface tools can defined as "any software that
helps create user interfaces". According to their functionality and abstraction level, three categories of user interface tools can be distinguished, Windowing System, Toolkit, Higher-level Tools.
Windowing System-
A windowing system is a software package that helps the user monitor and control different contexts by separating them physically onto different parts of one or more display screens. When the programmer wants to draw application-specific parts of the interface and allow the user to manipulate them the window system interface must be used directly. The X system divides the window functionality into two layers: the window system, which is the functional or programming interface, and the window manager which is the user interface. Thus the "window system" provides procedures that allow the application to draw pictures on the screen and get input from the user, and the "window manager" allows the end user to move windows around, and is responsible for displaying the title lines, borders and icons around windows.
such as menus. A problem with toolkits is that the styles of interaction are limited to those provided. In addition, the toolkits themselves are often expensive to create: "The primitives never seem complex in principle, but the programs that implement them are surprisingly intricate". Another problem with toolkits is that they are often difficult to use since they may contain hundreds of procedures, and it is often not clear how to use the procedures to create a desired interface. Though there are many small differences among the various toolkits, much remains the same. For example, all have some type of menu, button, scroll bar, text input field, etc. Therefore, a number of systems have been developed that try to hide the differences among the various toolkits, by providing a virtual widgets which can be mapped into widgets of each toolkit. Another name for these tools is cross-platform development systems.
Since programming at the toolkits level is quite difficult, there is a tremendous interest in higher level tools. Many higher level tools have components that operate at different times. The design time component helps the user interface designer design the user interface. For example, this might be a graphical editor which can lay out the interface, or a compiler to process a user interface specification language. The next phase is when the enduser is using the program. Here, the run-time component of the tool is used. This usually includes a toolkit, but may also include additional software specifically for the tool. There may also be an after-run-time component that helps with the evaluation and debugging of the user interface. Among them, we are most interested in the run-time component. We define GUI builder tool as any higher level user interface tool with run-time component that help programmer/end-user build graphical interface, which will be discussed in details in the following sections.
Application framework
- After the Macintosh Toolbox had been available for a little while, Apple discovered that programmers had a difficult time figuring out how to call the various toolkit functions, and how to ensure that the resulting interface met the Apple guidelines. They therefore created a software system that provides an overall application framework to guide programmers. This was called MacApp [5] and used the object-oriented language Object Pascal. Classes are provided for the important parts of an application, such as the main windows, the commands, etc., and the programmer specializes these classes to provide the applicationspecific details, such as what is actually drawn in the windows and which commands are provided. MacApp was very successful at simplifying the writing of Macintosh applications. Today, there are multiple frameworks to help build applications for most major platforms, including the Microsoft Foundation Classes for Windows, and the CodeWarrior Power Plant [6] for the Macintosh.
Model-based generation - A problem with all of the language-based tools is that the
designer must specify a great deal about the placement, format, and design of the user interfaces. To solve this problem, some tools use automatic generation so that the tool makes many of these choices from a much higher-level specification. Many of these tools, such as Mickey [12] , Jade [13] , and DON [14] have concentrated on creating menus and dialog boxes. Jade allows the designer to use a graphical editor to edit the generated interface if it is not good enough. DON has the most sophisticated layout mechanisms and takes into account the desired window size, balance, columns, symmetry, grouping, etc. Creating dialog boxes automatically has been very thoroughly researched, but there still are no commercial tools that do this. UIDE (the UserInterface Design Environment) [15] requires that the semantics of the application be defined in a special-purpose language, and therefore might be included with the language-based tools. It is placed here instead because the language is used to describe the functions that the application supports and not the desired interface. UIDE is classified as a ``model-based'' approach because the specification serves as a high-level, sophisticated model of the application semantics. In UIDE, the description includes pre- and post-conditions of the operations, and the system uses these to reason about the operations, and to automatically generate an interface. One interesting feature of UIDE is that the pre- and post-conditions are used to automatically generate help.
Interactive tools - Interface tools allow the designer to create dialog boxes, menus and
windows that are to be part of a larger user interface. They allow the designer to select from a pre-defined library of widgets, and place them on the screen using a mouse. Other properties of the widgets can be set using property sheets. Usually, there is also some support for sequencing, such as bringing up sub-dialogs when a particular button is hit. The Steamer project at BBN demonstrated many of the ideas later incorporated into interface builders and was probably the first object-oriented graphics system [16]. Other examples of research interactive tools are Dialog Editor [17] , vu [18] and Gilt [19]. There are literally hundreds of commercial tools. Just two examples are the NeXT Interface Builder [20] and UIM/X for X [21]. Visual Basic can also be considered as an interactive tool coupled with an editor for an interpreted language. Interactive tools use the actual widgets from a toolkit, so they can be used to build parts of real applications. Most will generate C code templates that can be compiled along with the application code. Others generate a description of the interface in a language that can be read at run-time. For example, UIM/X generates a UIL description. It is usually important that the programmer not edit the output of the tools (such as the generated C code) or else the tool can no longer be used for later modifications.
being Glade, Codegear's Delphi and C++ Builder, which stream UI objects similarly), NIBs are often referred to as freeze dried because they contain the archived objects themselves, ready to run. As of Interface Builder version 3, a new file format (with extension .xib) has been added, which is functionally identical to .nib, except it is stored in a flat file, making it more suitable for storage in revision control systems and processing by tools such as diff.
File's Owner and First Responder.- File's Owner: This is the object that loads the
xib file. In a completely generic sense, this is the object passed as the owner parameter to [NSBundle loadNibNamed:owner:]. When working with a nib for a UI View Controller subclass, this is usually the UI View Controller subclass itself. Further reading: Resource Programming Guide: Nib Files
First Responder: This is the view that receives untargeted events (i.e. those sent with a
target ofnil) first. The useful part of this is that it's connected to the idea of the responder chain, which is a mechanism by which things higher up in the view hierarchy can capture unhandled and deal with them. This concept originated on the Mac, and is particularly useful for implementing something like the "Copy" menu item. The first responder is the target of the "Copy" menu item, meaning that the selected text field gets a chance to handle the copy event first, then its superview, and so on. Further reading: iPhone Application Programming Guide: Event Handling
application's UIApplication object. It typically receives general status messages about the application, such as when it starts, ends and what not. It's a good spot to kick off things that need to happen when your app starts or shuts down. Further reading: Cocoa Fundamentals Guide: Delegates and Data Sources Hope that helps.
Cocoa Touch Design Patterns: Coca touch for the iPhone, iPod Touch, and iPad
- Cocoa Touch is an API for building software programs to run on the iPhone, iPod Touch, and iPad from Apple Inc. Cocoa Touch provides an abstraction layer of iOS, the operating system for the iPhone, iPod Touch, and iPad. Cocoa Touch is based on the Mac OS X Cocoa API toolset and, like it, is primarily written in the Objective-C language. Cocoa Touch allows the use of hardware and features that are not found in Mac OS X computers and are thus unique to the iOS range of
devices. Just like Cocoa, Cocoa Touch follows a Model-View-Controller (MVC) software architecture. Tools for developing applications based on Cocoa Touch are included in the iPhone SDK Cocoa Touch is based on Cocoa, and embodies various object-oriented design patterns also used for programming on the Mac. Understanding those patterns is essential to becoming a competent iOS developer. You'll learn the benefits of model-view-controller (MVC), delegation, notifications, and other fundamental design patterns in Cocoa Touch.
or show and hide different parts of content at different times. View controller objects provide the infrastructure for managing your content-related views and for coordinating the showing and hiding of them. There are many reasons to use view controllers in your application and very few reasons to avoid them. View controllers make it easier for you to implement many of the standard interface behaviors found in iOS applications. They provide default behavior that you can use as is or customize when needed. They also provide a convenient way to organize your applications user interface and content.
tool that you have at your disposal for interrupting the current workflow and displaying a new set of views. A modal view controller is not a specific subclass of UI View Controller, like UIT ab Bar Controller or UI Navigation Controller are. Instead, any view controller can be presented modally by your application. However, like tab bar and navigation controllers, you present view controllers modally when you want to convey a specific meaning about the relationship between the previous view hierarchy and the newly presented view hierarchy. There are several reasons to use modal view controllers in your application:
Use them to gather information from the user immediately. Use them to present some content temporarily. Use them to change work modes temporarily. Use them to implement alternate interfaces for different device orientations. Use them to present a new view hierarchy with a specific type of animated transition (or no transition).
Table Views - In this tutorial will learn how to use Table View and also how to add object to
table view, will add or insert the object into the Table View. Then will set the number of rows and the component into the Table View, when you click on the object will take you to the next view.Table views are commonly found in iPhone applications, especially productivity applications. They are versatile user-interface objects that you can adapt for different needs. A table presents a scrollable list of items (or rows) that may be divided into sections. Each row may display strings, images, or other identifiers of the represented data item. Users can select a row in a table and, as a result, be presented with another table view that lists items related to the item
selected in the first table view.Will add two ViewController to the Project and the Project is Based on Window Based Application, My project name is iphoneTableView.
Manage Navigation -
mobile device. You'll learn how to use navigation and tab bar controllers to improve the user experience of your app.
Gesture Recognizers - Take advantage of the touch screen by learning how to handle
touch events with the new gesture recognizers. First introduced for the iPad and now available in iPhone 4, gesture recognizers make it easy for you to detect and respond to taps, swipes, and other gestures.
Animation-
Users expect your app to look and behave like other apps on their phone. One
of the keys is practical use of animation. You'll learn how to employ simple techniques to enhance your app to animate various views. You'll also learn how to use the new blocks syntax in iOS SDK 4 to clarify your code.