iOS Reference Library Apple Developer
Search

About iOS Development

iOS is the operating system that runs on iPhone, iPod touch, and iPad devices. This operating system manages the device hardware and also provides the basic technologies needed to implement native applications on the phone. Depending on the device, the operating system also ships with several system applications, such as Phone, Mail, and Safari, that provide standard system services for the user.

The iPhone SDK contains the tools and interfaces needed to develop, install, and run custom native applications. Native applications are built using the iOS system frameworks and the Objective-C language and they run directly on iOS. Unlike web applications, native applications are installed physically on a device and can run with or without the presence of a network connection. They reside next to other system applications and both the application and any user data is synced to the user’s computer through iTunes.

The iOS Architecture

The iOS architecture is similar to the basic architecture found in Mac OS X. At the high level, iOS acts as an intermediary between the underlying hardware and the applications that appear on the screen, as shown in Figure 1-1. Applications that you create never interact directly with the hardware but instead go through system interfaces, which interact with the appropriate drivers. This abstraction protects your application from changes to the underlying hardware.

Figure 1-1  Applications layered on top of iOS

High level platform architecture

Note: Even though your application is generally protected from changes to the underlying hardware, you still need to account for some differences between devices in your code. For example, an iPad or iPod touch may not be able to open URLs containing a phone number while an iPhone can.

The implementation of iOS technologies can be viewed as a set of layers, which are shown in “Game Kit Framework.” At the lower layers of the system are the fundamental services on which all applications rely, while higher-level layers contain more sophisticated services and technologies.

Figure 1-2  Layers of iOS

Layers of iOS

As you write your code, you should prefer the use of higher-level frameworks over lower-level frameworks whenever possible. The higher-level frameworks are there to provide object-oriented abstractions for lower-level constructs. These abstractions generally make it much easier to write code because they reduce the number of lines of code you have to write and encapsulate potentially complex features, such as sockets and threads. Although they abstract out lower-level technologies, they do not mask those technologies from you. The lower-level frameworks are still available for developers who prefer using them or who want to use aspects of those frameworks that are not exposed at the higher level.

The technologies and frameworks for each layer are described in later chapters of this document.

What’s in the iPhone SDK?

The iPhone SDK comes with all of the interfaces, tools, and resources needed to develop iOS applications from your Intel-based Macintosh computer.

Apple delivers most of its system interfaces in special packages called frameworks. A framework is a directory that contains a dynamic shared library and the resources (such as header files, images, helper applications, and so on) needed to support that library. To use frameworks, you link them into your application project just as you would any other shared library. Linking them to your project gives you access to the features of the framework and also lets the development tools know where to find the header files and other framework resources.

In addition to frameworks, Apple also delivers some technologies in the form of standard shared libraries. Because iOS is based on UNIX, many of the technologies that form the lower-levels of the operating system are derived from open-source technologies. The interfaces for these technologies are therefore available in the standard library and interface directories.

Some of the other key components of the SDK include the following:

Although the SDK provides the software you need to write applications, Xcode and Instruments also let you interact directly with an attached device to run and debug your code on the target hardware. Development on an actual device requires signing up for Apple’s paid iPhone Developer Program and configuring a device for development purposes. For more information about the iPhone Developer Program, go to http://developer.apple.com/iphone/program/.

For information on how to install the iPhone SDK and use it for developing iOS applications, see iOS Development Guide. For more information about the frameworks in iOS, and for information about where to find the low-level system libraries, see “iOS Frameworks.”

What Can You Create?

Users can run two different types of custom applications on a device: web applications and native applications. Web applications use a combination of HTML, cascading style sheets, and JavaScript code to implement interactive applications that live on a web server and are transmitted over the network and run inside the Safari web browser. Native applications, on the other hand, are installed directly on the device and can run without the presence of a network connection.

The iPhone SDK supports the creation of native applications that appear on the device’s Home screen only. It does not support the creation of other types of code, such as drivers, frameworks, or dynamic libraries. If you want to integrate code from a framework or dynamic library into your application, you should link that code statically into your application’s executable file when building your project.

How to Use the Reference Library

The iOS Reference Library contains documentation, sample code, tutorials, and more to help you start writing iOS applications. Because the reference library contains thousands of pages of documentation, ranging from high-level getting started documents to low-level API reference documents, understanding how to find the information is an important step in the development process. The reference library uses a few different techniques for organizing content that should make it easier to browse.

You can access the iOS Reference Library from the Apple Developer website or from Xcode. In Xcode, choosing Help > Developer Documentation displays the Xcode documentation window, which is the central resource for accessing information about iOS development. You can use this window to browse the documentation, perform searches, and bookmark documents you may want to refer to later. Documents are grouped by content into doc sets to facilitate updates and to scope searches to only the relevant set of documents.

When you install the iPhone SDK, Xcode automatically installs the docset containing the iOS Reference Library for you to use. (Xcode also downloads docset updates for you automatically, although you can change that setting in preferences.) The iOS Reference Library contains a lot of information so it is worth becoming at least somewhat familiar with its layout. Figure 1-3 shows the main page of the reference library in the Xcode documentation window. The toolbar at the top of the page include a search field and buttons for navigating to other installed docsets and to any bookmarks you created. You can browse the library by topic, by framework, or by the type of resource you are looking for. You can also use the filter control above the list of documents to narrow the set of displayed documents.

Figure 1-3  The iOS Reference Library

The iPhone Reference LibraryThe iPhone Reference Library

Important: The content of the iOS Reference Library is updated regularly, but you can also access the latest documentation, release notes, Tech Notes, Technical Q&As, and sample code from the iPhone Dev Center (http://developer.apple.com/iphone). All documents are available in HTML and most are also available in PDF format.

Because the reference library provides a tremendous amount of information, sorting through all that information while you are trying to write code can be cumbersome. To help you find specific information quickly, Xcode also provides a Quick Help window, shown in Figure 1-4. This window shows you information about the designated symbol, including its syntax, description, and availability. It also shows you any related documentation and sample code resources. Clicking the links in this window takes you to the corresponding resource in the reference library. To display this window, hold down the Option key and double-click a symbol in the Xcode editor window.

Figure 1-4  Quick help in Xcode

The Xcode Research Assistant

For more information about using the Documentation and Quick Help windows, see Xcode Workspace Guide.




Last updated: 2010-07-08

Did this document help you? Yes It's good, but... Not helpful...