Objective C

Páginas: 184 (45939 palabras) Publicado: 24 de enero de 2013
iOS App Programming
Guide

Contents

About iOS App Programming 8
At a Glance 8
Translate Your Initial Idea into an Implementation Plan 8
UIKit Provides the Core of Your App 8
Apps Must Behave Differently in the Foreground and Background 9
iCloud Affects the Design of Your Data Model and UI Layers 9
Apps Require Some Specific Resources 9
Apps Should Restore Their Previous UI State atLaunch Time 9
Many App Behaviors Can Be Customized 10
Apps Must Be Tuned for Performance 10
The iOS Environment Affects Many App Behaviors 10
How to Use This Document 10
Prerequisites 11
See Also 11

App Design Basics 12
Doing Your Initial Design 12
Learning the Fundamental iOS Design Patterns and Techniques 13
Translating Your Initial Design into an Action Plan 13
Starting the AppCreation Process 14

Core App Objec ts 17
The Core Objects of Your App 17
The Data Model 20
Defining a Custom Data Model 21
Defining a Structured Data Model Using Core Data 24
Defining a Document-Based Data Model 24
Integrating iCloud Support Into Your App 26
The User Inter face 26
Building an Inter face Using UIKit Views 27
Building an Inter face Using Views and OpenGL ES 29
The AppBundle 30

App States and Multitask ing 33

2012-09-19 | © 2012 Apple Inc. All Rights Reserved.

2

Contents

Managing App State Changes 34
The App Launch Cycle 36
Responding to Interruptions 42
Moving to the Background 44
Returning to the Foreground 48
App Termination 51
The Main Run Loop 52
Background Execution and Multitasking 54
Determining Whether Multitasking Is Available 54Executing a Finite-Length Task in the Background 55
Scheduling the Delivery of Local Notifications 56
Implementing Long-Running Background Tasks 58
Being a Responsible Background App 63
Opting out of Background Execution 65
Concurrency and Secondary Threads 66

State Preser vation and Restoration 67
The Preservation and Restoration Process 67
Flow of the Preservation Process 74
Flow ofthe Restoration Process 75
What Happens When You Exclude Groups of View Controllers? 78
Checklist for Implementing State Preservation and Restoration 81
Enabling State Preservation and Restoration in Your App 82
Preserving the State of Your View Controllers 82
Marking Your View Controllers for Preservation 83
Restoring Your View Controllers at Launch Time 83
Encoding and Decoding Your ViewController’s State 85
Preserving the State of Your Views 86
UIKit VIews with Preservable State 87
Preserving the State of a Custom View 88
Implementing Preservation-Friendly Data Sources 89
Preserving Your App’s High-Level State 89
Mixing UIKit’s State Preservation with Your Own Custom Mechanisms 90
Tips for Saving and Restoring State Information 91

App-Related Resources 93
App StoreRequired Resources 93
The Information Property List File 93
Declaring the Required Device Capabilities 94
Declaring Your App’s Supported Document Types 97

2012-09-19 | © 2012 Apple Inc. All Rights Reserved.

3

Contents

App Icons 98
App Launch (Default) Images 100
Providing Launch Images for Different Orientations 101
Providing Device-Specific Launch Images 103
Providing LaunchImages for Custom URL Schemes 103
The Settings Bundle 104
Localized Resource Files 105
Loading Resources Into Your App 106

Advanced App Tricks 108
Creating a Universal App 108
Updating Your Info.plist Settings 108
Implementing Your View Controllers and Views 109
Updating Your Resource Files 110
Using Runtime Checks to Create Conditional Code Paths 110
Supporting Multiple Versions of iOS111
Launching in Landscape Mode 112
Installing App-Specific Data Files at First Launch 113
Protecting Data Using On-Disk Encryption 113
Tips for Developing a VoIP App 115
Configuring Sockets for VoIP Usage 116
Installing a Keep-Alive Handler 117
Configuring Your App’s Audio Session 117
Using the Reachability Inter faces to Improve the User Experience 118
Communicating with Other Apps 118...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Objective
  • Diferencias Objective C y C
  • objective c en computo
  • objectivismo y relativismo
  • Desarrollo de aplicaciones para iphone y objective-c.
  • Research Objectives
  • Management by objectives
  • Management By Objective

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS