lunes, 16 de enero de 2012

iOS Developer Tools

iOS Developer Tools

To develop applications for iOS, you need an Intel-based Macintosh computer and the Xcode tools. Xcode is Apple’s suite of development tools that provide support for project management, code editing, building executables, source-level debugging, source-code repository management, performance tuning, and much more. At the center of this suite is the Xcode application itself, which provides the basic source-code development environment. Xcode is not the only tool, though, and the following sections provide an introduction to the key applications you use to develop software for iOS.



Xcode

The focus of your development experiences is the Xcode application. Xcode is an integrated development environment (IDE) that provides all of the tools you need to create and manage your iOS projects and source files, assemble your user interface, build your code into an executable, and run and debug your code either in iOS Simulator or on a device. Xcode incorporates a number of features to make developing iOS applications easier, including the following:
  • A project management system for defining software products
  • A code-editing environment that includes features such as syntax coloring, code completion, and symbol indexing
  • An integrated editor for creating storyboard and nib files
  • An advanced documentation viewer for viewing and searching Apple documentation
  • A context-sensitive inspector for viewing information about selected code symbols
  • An advanced build system with dependency checking and build rule evaluation
  • LLVM and Clang support for C, C++, and Objective-C
  • GCC compilers supporting C, C++, Objective-C, Objective-C++, and other languages
  • A static analyzer for validating the behavior of your app and identifying potential problems.
  • Integrated source-level debugging using GDB
  • Support for integrated source-code management
  • Support for DWARF and Stabs debugging information (DWARF debugging information is generated by default for all new projects)
  • Support for managing iOS development devices.
To create a new iOS application, you start by creating a new project in Xcode. A project manages all of the information associated with your application, including the source files, build settings, and rules needed to put all of the pieces together. The heart of every Xcode project is the project window, shown in Figure A-1. This window provides quick access to all of the key elements of your application. In the Groups & Files list, you manage the files in your project, including the source files and build targets that are created from those source files. In the toolbar, you access commonly used tools and commands. You can then configure the workspace to display the panes you need for editing, navigating your project content, debugging, and obtaining additional information about items.
Figure A-1  An Xcode project window
An Xcode project window
When you build your application in Xcode, you have a choice of building it for iOS Simulator or for a device. Simulator provides a local environment for testing your applications to make sure they behave essentially the way you want. After you are satisfied with your application’s basic behavior, you can tell Xcode to build your application and run it on an iOS-based device connected to your computer. Running your application on a device provides the ultimate test environment, and Xcode lets you attach the built-in debugger to the code running there.
Figure A-2  Running a project from Xcode
Running a project from Xcode

Instruments

To ensure that you deliver the best user experience for your software, the Instruments environment lets you analyze the performance of your iOS applications while running in Simulator or on a device. Instruments gathers data from your running application and presents that data in a graphical display called the timeline view. You can gather data about your application’s memory usage, disk activity, network activity, and graphics performance. The timeline view can display all the types of information side by side, letting you correlate the overall behavior of your application, not just the behavior in one specific area. To get even more detailed information, you can also view the detailed samples that Instruments gathers.



Figure A-3  Using Instruments to tune your application
Using Instruments to tune your application

In addition to providing the timeline view, Instruments provides tools to help you analyze your application’s behavior over time. For example, the Instruments window lets you store data from multiple runs so that you can see whether your application’s behavior is actually improving or whether it still needs work. You can save the data from these runs in an Instruments document and open them at any time. 

iOS Frameworks

This appendix contains information about the frameworks of iOS. These frameworks provide the interfaces you need to write software for the platform. Where applicable, the tables in this appendix list any key prefixes used by the classes, methods, functions, types, or constants of the framework. Avoid using any of the specified prefixes in your own symbol names.



Device Frameworks

Table B-1 describes the frameworks available in iOS-based devices. You can find these frameworks in the <Xcode>/Platforms/iPhoneOS.platform/Developer/SDKs/<iOS_SDK>/System/Library/Frameworks directory, where <Xcode> is the path to your Xcode installation directory and <iOS_SDK> is the specific SDK version you are targeting. The "First available” column lists the iOS version in which the framework first appeared.
Table B-1  Device frameworks
NameFirst availablePrefixesDescription
Accelerate.framework4.0cblas, vDSPContains accelerated math and DSP functions. See Accelerate Framework Reference.
Accounts.framework5.0ACContains interfaces for managing access to a user’s system accounts. See Accounts Framework Reference.
AddressBook.framework2.0ABContains functions for accessing the user’s contacts database directly. See Address Book Framework Reference for iOS.
AddressBookUI.framework2.0ABContains classes for displaying the system-defined people picker and editor interfaces. See Address Book UI Framework Reference for iOS.
AssetsLibrary.framework4.0ALContains classes for accessing the user’s photos and videos. See Assets Library Framework Reference.
AudioToolbox.framework2.0AU, AudioContains the interfaces for handling audio stream data and for playing and recording audio. See Audio Toolbox Framework Reference.
AudioUnit.framework2.0AU, AudioContains the interfaces for loading and using audio units. See Audio Unit Framework Reference.
AVFoundation.framework2.2AVContains Objective-C interfaces for playing and recording audio and video. See AV Foundation Framework Reference.
CFNetwork.framework2.0CFContains interfaces for accessing the network via Wi-Fi and cellular radios. See CFNetwork Framework Reference.
CoreAudio.framework2.0AudioProvides the data types used throughout Core Audio. See Core Audio Framework Reference.
CoreBluetooth.framework5.0CBProvides access to low-power Bluetooth hardware.
CoreData.framework3.0NSContains interfaces for managing your application’s data model. See Core Data Framework Reference.
CoreFoundation.framework2.0CFProvides fundamental software services, including abstractions for common data types, string utilities, collection utilities, resource management, and preferences. See Core Foundation Framework Reference.
CoreGraphics.framework2.0CGContains the interfaces for Quartz 2D. See Core Graphics Framework Reference.
CoreImage.framework5.0CIContains interfaces for manipulating video and still images. See Core Image Reference Collection.
CoreLocation.framework2.0CLContains the interfaces for determining the user’s location. See Core Location Framework Reference.
CoreMedia.framework4.0CMContains low-level routines for manipulating audio and video. See Core Media Framework Reference.
CoreMIDI.framework4.2MIDIContains low-level routines for handling MIDI data. See Core MIDI Framework Reference.
CoreMotion.framework4.0CMContains interfaces for accessing accelerometer and gyro data. See Core Motion Framework Reference.
CoreTelephony.framework4.0CTContains routines for accessing telephony-related information. See Core Telephony Framework Reference.
CoreText.framework3.2CTContains a text layout and rendering engine. See Core Text Reference Collection.
CoreVideo.framework4.0CVContains low-level routines for manipulating audio and video. Do not use this framework directly.
EventKit.framework4.0EKContains interfaces for accessing a user’s calendar event data. See Event Kit Framework Reference.
EventKitUI.framework4.0EKContains classes for displaying the standard system calendar interfaces. See Event Kit UI Framework Reference.
ExternalAccessory.framework3.0EAContains interfaces for communicating with attached hardware accessories. See External Accessory Framework Reference.
Foundation.framework2.0NSContains interfaces for managing strings, collections, and other low-level data types. See Foundation Framework Reference.
GameKit.framework3.0GKContains the interfaces for managing peer-to-peer connectivity. See Game Kit Framework Reference.
GLKit.framework5.0GLKContains Objective-C utility classes for building complex OpenGL ES applications. See GLKit Framework Reference.
GSS.framework5.0gssProvides a standard set of security-related services.
iAd.framework4.0ADContains classes for displaying advertisements in your application. See iAd Framework Reference.
ImageIO.framework4.0CGContains classes for reading and writing image data. See Image I/O Reference Collection.
IOKit.framework2.0N/AContains interfaces used by the device. Do not include this framework directly.
MapKit.framework3.0MKContains classes for embedding a map interface into your application and for reverse-geocoding coordinates. See Map Kit Framework Reference.
MediaPlayer.framework2.0MPContains interfaces for playing full-screen video. See Media Player Framework Reference.
MessageUI.framework3.0MFContains interfaces for composing and queuing email messages. See Message UI Framework Reference.
MobileCoreServices.framework3.0UTDefines the uniform type identifiers (UTIs) supported by the system.
NewsstandKit.framework5.0NKProvides interfaces for downloading magazine and newspaper content in the background. See Newsstand Kit Framework Reference.
OpenAL.framework2.0ALContains the interfaces for OpenAL, a cross-platform positional audio library. For more information, go to http://www.openal.org.
OpenGLES.framework2.0EAGL, GLContains the interfaces for OpenGL ES, which is an embedded version of the OpenGL cross-platform 2D and 3D graphics rendering library. See OpenGL ES Framework Reference.
QuartzCore.framework2.0CAContains the Core Animation interfaces. See Quartz Core Framework Reference.
QuickLook.framework4.0QLContains interfaces for previewing files. See Quick Look Framework Reference.
Security.framework2.0CSSM, SecContains interfaces for managing certificates, public and private keys, and trust policies. See Security Framework Reference.
StoreKit.framework3.0SKContains interfaces for handling the financial transactions associated with in-app purchases. See Store Kit Framework Reference.
SystemConfiguration.framework2.0SCContains interfaces for determining the network configuration of a device. See System Configuration Framework Reference.
Twitter.framework5.0TWContains interfaces for sending tweets via the Twitter service. See Twitter Framework Reference.
UIKit.framework2.0UIContains classes and methods for the iOS application user interface layer. See UIKit Framework Reference.

Simulator Frameworks

Although you should always target the device frameworks when writing your code, you might need to compile your code specially for Simulator during testing. The frameworks available on the device and in Simulator are mostly identical, but there are a handful of differences. For example, Simulator uses several Mac OS X frameworks as part of its own implementation. In addition, the exact interfaces available for a device framework and a Simulator framework may differ slightly because of system limitations. For a list of frameworks and for information about the specific differences between the device and Simulator frameworks.

System Libraries

Note that some specialty libraries at the Core OS and Core Services level are not packaged as frameworks. Instead, iOS includes many dynamic libraries in the /usr/lib directory of the system. Dynamic shared libraries are identified by their .dylib extension. Header files for the libraries are located in the /usr/include directory.
Each version of the iOS SDK includes a local copy of the dynamic shared libraries that are installed with the system. These copies are installed on your development system so that you can link to them from your Xcode projects. To see the list of libraries for a particular version of iOS, look in <Xcode>/Platforms/iPhoneOS.platform/Developer/SDKs/<iOS_SDK>/usr/lib, where <Xcode> is the path to your Xcode installation directory and <iOS_SDK> is the specific SDK version you are targeting. For example, the shared libraries for the iOS 4.2 SDK would be located in the /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/lib directory, with the corresponding headers in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/include.
iOS uses symbolic links to point to the current version of most libraries. When linking to a dynamic shared library, use the symbolic link instead of a link to a specific version of the library. Library versions may change in future versions of iOS; if your software is linked to a specific version, that version might not always be available on the user’s system.


No hay comentarios:

Publicar un comentario

Clima