ContentsIntroduction Introduction 13Who Should Read This Document? 14Organization of This Document 14Providing Feedback 15See Also 15Chapter 1 iPhone OS Overview 17iPhone OS Feature Summary 17Development Tools 19About iPhone Development 19Application Styles 20Application Basics 23The Multi-Touch Interface 25Windows and Drawing 26Key Integration Features 28Before You Go Any Further 31Chapter 2 iPhone OS Technologies 33Cocoa Touch 33Media 34Graphics Technologies 34Core Audio 35OpenAL 36Video Technologies 36Core Services 37Address Book 37Core Foundation 37Core Location 38CFNetwork 38Security 38SQLite 39XML Support 39Core OS 3932008-07-08 | 2008 Apple Inc. All Rights Reserved.Chapter 3 Development Environment 41The Development Process 41Creating Your Project and Writing Code 42Beginnings 43Using Code Completion 48Using API Reference Lookup 49Accessing Documentation 51Setting Your Application’s Icon 52Building and Running Your Application 52Working with the iPhone Simulator 53Building Your Application for the iPhone Simulator 53Running Your Application on the Simulator 53Capabilities of the iPhone Simulator 55Working with a Device 55Preparing Devices for Development 55Building Your Application for a Device 60Running Your Application on a Device 60Using the Organizer 60Backing Up Your Digital Identifications 62Debugging Your Code and Measuring Performance 63Debugging with Xcode 63Tuning Application Performance 65Conditional Linking to System Frameworks 66Managing Application Data 67Chapter 4 Application Design Guidelines 69The Runtime Environment 69Fast Launch, Short Use 70The Virtual Memory System 70Managing Your Memory Usage 70Reducing Your Application’s Memory Footprint 71Allocating Memory Wisely 71Observing Low-Memory Notifications 72Performance and Responsiveness 73Using Memory Efficiently 73Improving Drawing Performance 73Reducing Power Consumption 74Tuning Your Code 74Security 74The Application Sandbox 74Using the Available Security Technologies 75File and Data Management 76Application Directory Structure 76Backup and Restore 7742008-07-08 | 2008 Apple Inc. All Rights Reserved.C O N T E N T SGetting Paths to Application Directories 78Reading and Writing File Data 79File Access Guidelines 83Saving State Information 83Case Sensitivity 84Networking 84User Interface Design Considerations 84Chapter 5 The Application Environment 87Core Application Architecture 87The Event and Drawing Cycle 87The Application Life Cycle 90Application Interruptions 92The Application Bundle 93Application Configuration 95The Information Property List 95Custom URL Schemes and Interapplication Communication 98Application Icon and Launch Images 102The Settings Bundle 102Launching in Landscape Mode 102Internationalizing Applications 105Chapter 6 Windows and Views 109What AreWindows and Views? 109The Role of UIWindow 109The Role of UIView 110UIKit View Classes 111The Role of View Controllers 114View Architecture and Geometry 114The View Interaction Model 114The View Rendering Architecture 117View Coordinate Systems 119The Relationship of the Frame, Bounds, and Center 120Coordinate System Transformations 121Content Modes and Scaling 122Autoresizing Behaviors 124Creating and Managing the View Hierarchy 125Creating a View Object 127Adding and Removing Subviews 127Converting Coordinates in the View Hierarchy 129Tagging Views 130Modifying Views at Runtime 131Animating Views 131Responding to Layout Changes 13352008-07-08 | 2008 Apple Inc. All Rights Reserved.C O N T E N T SRedrawing Your View’s Content 134Hiding Views 134Creating a Custom View 134Initializing Your Custom View 135Drawing Your View’s Content 135Responding to Events 136Cleaning Up After Your View 137Chapter 7 Event Handling 139Events and Touches 140Event Delivery 141Responder Objects and the Responder Chain 141Regulating Event Delivery 142Handling Multi-Touch Events 143The Event-Handling Methods 143Handling Single and Multiple Tap Gestures 144Detecting Swipe Gestures 146Handling a Complex Multi-Touch Sequence 147Event-Handling Techniques 148Chapter 8 Graphics and Drawing 151Quartz Concepts and Terminology 151The View Drawing Cycle 152The Native Coordinate System 152Graphics Contexts 153Points Versus Pixels 154Color and Color Spaces 155Supported Image Formats 155Drawing Tips 156Deciding When to Use Custom Drawing Code 156Improving Drawing Performance 156Maintaining Image Quality 157Drawing with Quartz and UIKit 157Configuring the Graphics Context 158Creating and Drawing Images 160Creating and Drawing Paths 161Drawing Text 161Creating Patterns, Gradients, and Shadings 161Drawing with OpenGL ES 162Setting Up a Rendering Surface 162Best Practices 164Implementation Details 166For More Information 169Applying Core Animation Effects 17062008-07-08 | 2008 Apple Inc. All Rights Reserved.C O N T E N T SAbout Layers 170About Animations 171Chapter 9 Audio and Video Technologies 173Using Sound in iPhone OS 173Audio Sessions 174Playing Short Sounds Using System Sound Services 174Playing Sounds with Control Using Audio Queue Services 176Playing Sounds with Positioning Using OpenAL 179Recording Audio 179Parsing Streamed Audio 180Mixing and Processing Sounds 180Audio Unit Support in iPhone OS 181Triggering Vibration 181Tips for Manipulating Audio 181Preferred Audio Formats in iPhone OS 182Playing Video Files 183Chapter 10 Device Features 185Accessing Accelerometer Events 185Choosing an Appropriate Update Interval 186Isolating the Gravity Component From Acceleration Data 187Isolating Instantaneous Motion From Acceleration Data 187Getting the Current Device Orientation 188Getting the User’s Current Location 188Taking Pictures with the Camera 190Picking a Photo from the Photo Library 192Chapter 11 Application Preferences 193Guidelines for Preferences 193The Preferences Interface 194The Settings Bundle 195The Settings Page File Format 196Hierarchical Preferences 197Localized Resources 198Adding the Settings Bundle to Your Application 198Editing Settings Pages 199Creating Settings Page Files 203Accessing Your Preferences 204Debugging Preferences for Simulated Applications 20572008-07-08 | 2008 Apple Inc. All Rights Reserved.C O N T E N T SAppendix A Apple Applications URL Schemes 207Mail Links 207Phone Links 208Map Links 209YouTube Links 210iTunes Links 210Document Revision History 21182008-07-08 | 2008 Apple Inc. All Rights Reserved……