Search and Find
Service
Contents
6
Acknowledgments
17
Preface
18
Welcome to the Jungle
19
What This Book Is
19
What You Need Before You Can Begin
20
What You Need to Know Before You Begin
22
What’s Different About Coding for iPhone?
23
What’s in This Book
26
Are You Ready?
28
Appeasing the Tiki Gods
29
Setting Up Your Project in Xcode
29
Introducing Interface Builder
35
Some iPhone Polish— Finishing Touches
41
Bring It on Home
45
Handling Basic Interaction
46
The Model- View-Controller Paradigm
47
Creating Our Project
48
Creating the View Controller
48
Using the Application Delegate
58
Editing MainWindow.xib
61
Editing Button_FunViewController.xib
62
Bring It on Home
69
More User Interface Fun
70
A Screen Full of Controls
71
Active, Static, and Passive Controls
72
Creating the Application
73
Build and Run
84
Implementing the Slider and Label
87
Implementing the Switches and Segmented Control
91
Implementing the Button, Action Sheet, and Alert
96
Showing an Action Sheet
98
Spiffing Up the Button
101
Crossing the Finish Line
104
Autorotation and Autosizing
105
Handling Rotation Using Autosize Attributes
107
Restructuring a View When Rotated
113
Swapping Views
118
Rotating Out of Here
127
Multiview Applications
128
The View Switcher Application
131
The Architecture of a Multiview Application
132
Building View Switcher
133
Animating the Transition
147
Refactoring
150
Switching Off
152
Tab Bars and Pickers
153
The Pickers Application
154
Delegates and Datasources
155
Setting Up the Tab Bar Framework
156
Implementing the Date Picker
162
Implementing the Single Component Picker
165
Implementing a Multicomponent Picker
172
Implementing Dependent Components
177
Creating a Simple Game with a Custom Picker
184
Final Spin
197
Introduction to Table Views
198
Table View Basics
199
Implementing a Simple Table
202
Adding an Image
207
Additional Configurations
208
Customizing Table View Cells
212
Grouped and Indexed Sections
222
Implementing a Search Bar
228
Putting It All on the Table
243
Navigation Controllers and Table Views
244
Navigation Controllers
245
Nav, a Hierarchical Application in Six Parts
246
Constructing the Nav Application’s Skeleton
249
Our First Subcontroller: The Disclosure Button View
257
Our Second Subcontroller: The Checklist
265
Our Third Subcontroller: Controls on Table Rows
270
Our Fourth Subcontroller: Moveable Rows
276
Our Fifth Subcontroller: Deletable Rows
283
Our Sixth Subcontroller: An Editable Detail Pane
289
But There’s One More Thing. . .
311
Breaking the Tape
314
Application Settings and User Defaults
315
Getting to Know Your Settings Bundle
316
The AppSettings Application
317
Creating the Project
318
Working with the Settings Bundle
321
Reading Settings in Our Application
331
Changing Defaults from Our Application
335
Beam Me Up, Scotty
339
Basic Data Persistence
340
Your Application’s Sandbox
341
File Saving Strategies
343
Persisting Application Data
344
The Persistence Application
346
The Archiving Application
356
Using iPhone’s Embedded SQLite3
361
Persistence Rewarded
370
Drawing with Quartz and OpenGL
371
Two Views of a Graphical World
372
This Chapter’s Drawing Application
373
The Quartz Approach to Drawing
373
Building the QuartzFun Application
378
Some OpenGL ES Basics
398
Drawing a Blank
410
Taps, Touches, and Gestures
411
Multitouch Terminology
412
The Responder Chain
412
The Multitouch Architecture
414
The Touch Explorer Application
416
The Swipes Application
420
Implementing Multiple Swipes
423
Detecting Multiple Taps
426
Detecting Pinches
430
Defining Custom Gestures
434
Garçon? Check, Please!
438
Where Am I? Finding Your Way with Core Location
439
The Location Manager
440
The Location Manager Delegate
441
Trying Out Core Location
444
Wherever You Go, There You Are
449
Whee!
450
Accelerometer Physics
450
Accessing the Accelerometer
451
Shake and Break
456
The Rolling Marble Program
461
Rolling On
470
iPhone Camera and Photo Library
471
Using the Image Picker and UIImagePickerController
472
Implementing the Image Picker Controller Delegate
473
Road Testing the Camera and Library
475
It’s a Snap!
480
Application Localization
481
Localization Architecture
481
Using String Files
483
Real- World iPhone: Localizing Your Application
485
Auf Wiedersehen
498
Where to Next?
499
Getting Unstuck
499
Farewell
502
Index
503
All prices incl. VAT