Table of Contents

Copyright

Brief Table of Contents

Table of Contents

Praise for iPhone in Action

Preface

Acknowledgments

About this Book

Chapter 1. Introducing the iPhone and iPad

1.1. A bit of history

1.2. All for one and one for all: the iPhone OS platform

1.3. Core hardware specifications

1.3.1. The iPhone

1.3.2. The iPad

1.3.3. The iPod Touch

1.3.4. iPhone and iPad input and output specifications

1.3.5. iPhone and iPad network specifications

1.3.6. iPhone OS browser specifications

1.3.7. Mobile web standards

1.3.8. Other hardware features

1.4. How the iPhone and iPad are unique

1.5. Understanding iPhone and iPad touch interaction

1.6. Summary

Chapter 2. Learning Objective-C and the iPhone OS SDK

2.1. Getting ready for the SDK

2.1.1. Installing the SDK

2.1.2. The anatomy of the SDK

2.2. Introducing Objective-C

2.2.1. The big picture

2.2.2. The message

2.2.3. Class definition

2.2.4. Properties

2.2.5. Other compiler directives

2.2.6. Categories and protocols

2.2.7. Wrapping up Objective-C

2.3. Introducing the iPhone OS

2.3.1. The anatomy of the iPhone OS

2.3.2. The object hierarchy of the iPhone OS

2.3.3. Windows and views

2.4. The iPhone OS’s methods

2.4.1. Object creation

2.4.2. Memory management

2.4.3. Event response

2.4.4. Lifecycle management

2.5. Summary

Chapter 3. Using Xcode

3.1. Introducing Xcode

3.1.1. The anatomy of Xcode

3.1.2. Compiling and executing in Xcode

3.2. Creating a first iPhone project in Xcode: Hello, World!

3.2.1. Understanding main.m

3.2.2. Understanding the application delegate

3.2.3. Writing Hello, World!

3.3. Creating a first iPad project in Xcode: Hello, World!

3.3.1. Writing Hello, World!

3.4. Creating a new class in Xcode

3.4.1. The new class how-to

3.4.2. The header file

3.4.3. The source code file

3.4.4. Linking it in

3.5. Other Xcode functionality

3.5.1. Adding frameworks with Xcode

3.5.2. Using alternate templates with Xcode

3.5.3. Xcode tips and tricks

3.6. Summary

Chapter 4. Using Interface Builder

4.1. An introduction to Interface Builder

4.1.1. The anatomy of Interface Builder

4.1.2. Simulating in Interface Builder

4.2. A first project in Interface Builder: pictures and the web

4.2.1. Creating new objects

4.2.2. Manipulating objects graphically

4.2.3. Using the inspector window

4.2.4. Working with pictures

4.3. Building connections in Interface Builder

4.3.1. Declaring an IBOutlet

4.3.2. Connecting an object

4.3.3. Coding with IBOutlets

4.4. Other Interface Builder functionality

4.4.1. Building other connections

4.4.2. Creating external objects

4.4.3. Initializing Interface Builder objects

4.4.4. Accessing .xib files

4.4.5. Creating new .xib files

4.5. Summary

Chapter 5. Creating basic view controllers

5.1. The view controller family

5.2. The standard view controller

5.2.1. The anatomy of a view controller

5.2.2. Creating a view controller

5.2.3. Creating another view controller

5.2.4. Building up a view controller interface

5.2.5. Using your view controller

5.3. The table view controller

5.3.1. The anatomy of a table view controller

5.3.2. Creating a table view controller

5.3.3. Building up a table interface

5.3.4. Using your table view controller

5.4. Summary

Chapter 6. Monitoring events and actions

6.1. An introduction to events

6.1.1. The responder chain

6.1.2. Touches and events

6.2. A touching example: the event reporter

6.2.1. Setting things up in Interface Builder

6.2.2. Preparing a view for touches

6.2.3. Controlling your events

6.3. Other event functionality

6.3.1. Regulating events

6.3.2. Other event methods and properties

6.4. An introduction to actions

6.4.1. The UIControl object

6.4.2. Control events and actions

6.4.3. Using addTarget:action:forControlEvents:

6.5. Adding a button to an application

6.5.1. Using addTarget:action:forControlEvents: with a button

6.5.2. Using an IBAction with a button

6.6. Other action functionality

6.6.1. Accepting text input with UITextField

6.6.2. Allowing value selection with UISlider

6.6.3. A TextField/Slider mashup

6.6.4. Actions made easy

6.6.5. Actions in use

6.7. Introducing notifications

6.8. Summary

Chapter 7. Creating advanced view controllers

7.1. The tab bar view controller

7.1.1. The anatomy of a tab bar view controller

7.1.2. Creating a tab bar view controller

7.1.3. Building a tab bar interface

7.1.4. Using your tab bar controller

7.2. The navigation controller

7.2.1. The anatomy of a navigation controller

7.2.2. Creating a navigation controller

7.2.3. Completing the navigation controller

7.2.4. Using your navigation controller

7.3. Using the flipside controller

7.4. The split view controller

7.4.1. Creating a split view controller

7.4.2. Building the split view controller

7.4.3. Using your split view controller

7.4.4. Adjusting the interface for vertical and landscape modes

7.5. Popover and modal view controllers

7.5.1. Creating a popover view controller

7.5.2. Creating a modal view controller

7.6. Summary

Chapter 8. Data: actions, preferences, and files

8.1. Accepting user actions

8.2. Maintaining user preferences

8.2.1. Creating your own preferences

8.2.2. Using the system settings

8.3. Opening files

8.3.1. Accessing your bundle

8.3.2. Accessing other directories

8.3.3. Manipulating files

8.3.4. Filesaver: a UITextView example

8.4. Summary

Chapter 9. Data: advanced techniques

9.1. Using SQLite

9.1.1. Setting up an SQLite database

9.1.2. Accessing SQLite

9.1.3. Accessing your SQLite database

9.1.4. Building a navigation menu from a database

9.1.5. Expanding this example

9.2. Accessing the Address Book

9.2.1. An overview of the frameworks

9.2.2. Accessing Address Book properties

9.2.3. Querying the Address Book

9.2.4. Using the Address Book UI

9.3. An introduction to Core Data

9.3.1. Background information about Core Data

9.3.2. Setting up Core Data in your application

9.3.3. Initializing the Core Data objects

9.3.4. Adding objects to the database

9.3.5. Fetching, updating, and deleting objects in Core Data

9.4. Summary

Chapter 10. Positioning: accelerometers, location, and the compass

10.1. The accelerometers and orientation

10.1.1. The orientation property

10.1.2. The orientation notification

10.2. The accelerometers and movement

10.2.1. Accessing the UIAccelerometer

10.2.2. Parsing the UIAcceleration

10.2.3. Checking for gravity

10.2.4. Checking for movement

10.2.5. Recognizing simple accelerometer movement

10.3. The accelerometers and gestures

10.4. All about Core Location

10.4.1. The location classes

10.4.2. An example using location and distance

10.4.3. An example using altitude

10.4.4. Using the compass

10.4.5. Core Location and the internet

10.5. Summary

Chapter 11. Media: images and the camera

11.1. An introduction to images

11.1.1. Loading a UIImage

11.1.2. Drawing a UIImageView

11.1.3. Modifying an image in the UIKit

11.2. Drawing simple images with Core Graphics

11.3. Accessing photos

11.3.1. Using the image picker

11.3.2. Taking photos

11.3.3. Saving to the photo album

11.4. Collage: an image example

11.4.1. The collage view controller

11.4.2. The collage temporary image view

11.4.3. The collage view

11.4.4. Further exploration of this example

11.5. Summary

Chapter 12. Media: audio and recording

12.1. Playing audio from the iPod library

12.1.1. Retrieving audio items from the iPod media library

12.1.2. Getting information about an MPMediaItem

12.1.3. Playing media items using MPMusicPlayerController

12.1.4. Example: creating a simple media player application

12.2. Recording audio

12.2.1. Initializing the audio recorder

12.2.2. Controlling the audio recorder

12.2.3. Responding to AVAudioRecorder events

12.3. Playing sounds manually

12.3.1. Initializing the AVAudioPlayer

12.3.2. The AVAudioPlayerDelegate

12.3.3. Controlling the AVAudioPlayer

12.4. Example: creating a simple audio recording/playback application

12.4.1. Creating a view-based application

12.4.2. Adding the needed frameworks

12.4.3. Setting up the IBActions

12.4.4. Creating the interface

12.4.5. Setting up the audio recorder and implementing the IBActions

12.5. Recording, playing, and accessing video

12.6. Summary

Chapter 13. Graphics: Quartz, Core Animation, and OpenGL

13.1. An introduction to Quartz 2D

13.2. The Quartz context

13.2.1. Drawing to a UIView

13.2.2. Drawing to a bitmap

13.3. Drawing paths

13.3.1. Finishing a path

13.3.2. Creating reusable paths

13.3.3. Drawing rectangles

13.4. Setting the graphical state

13.4.1. Setting colors

13.4.2. Making transformations

13.4.3. Setting clipping paths

13.4.4. Other settings

13.4.5. Managing the state

13.5. Advanced drawing in Quartz

13.5.1. Drawing gradients

13.5.2. Drawing images

13.5.3. Drawing words

13.5.4. What we didn’t cover

13.6. Drawing on a picture: an example

13.6.1. The PhotoDraw view controller

13.6.2. The photodraw view

13.6.3. Expanding on the example

13.7. An introduction to Core Animation

13.7.1. The fundamentals of Core Animation

13.7.2. Getting started with Core Animation

13.7.3. Drawing a simple implicit animation

13.7.4. Drawing a simple explicit animation

13.8. An introduction to OpenGL

13.9. Summary

Chapter 14. The web: web views and internet protocols

14.1. The hierarchy of the internet

14.2. Low-level networking

14.2.1. The CFHost class

14.3. Working with URLs

14.3.1. Creating an NSURL

14.3.2. Building an NSURLRequest

14.3.3. Manipulating HTML data by hand

14.4. Using UIWebView

14.4.1. Calling up the web view

14.4.2. Managing the web view delegate

14.4.3. Thumbnails: a web view example

14.5. Parsing XML

14.5.1. Starting up NSXMLParser

14.5.2. Acting as a delegate

14.5.3. Building a sample RSS reader

14.5.4. Altitude redux: a Core Location example

14.6. POSTing to the web

14.6.1. POSTing by hand

14.6.2. Submitting forms

14.7. Accessing the social web

14.7.1. Using web protocols

14.7.2. Using TouchJSON

14.8. Summary

Chapter 15. Peer-to-peer connections using Game Kit

15.1. Overview of Game Kit

15.2. Creating peer-to-peer applications using the peer picker

15.2.1. Using Apple’s built-in peer picker

15.2.2. Implementing the GKSessionDelegate methods

15.2.3. Sending and receiving data between peers

15.3. Example: creating a multiplayer table tennis game

15.3.1. Starting the GKTennis project

15.3.2. Creating the header file

15.3.3. Creating the table tennis interface

15.3.4. Game initialization

15.3.5. Setting up the peer picker and getting connected

15.3.6. Implementing the send and receive methods

15.3.7. The game loop

15.3.8. User interaction

15.4. Summary

Chapter 16. Push notification services

16.1. What are push notifications?

16.2. An overview of Apple’s push notification system

16.3. Preparing your application to use push notifications

16.3.1. Setting up your application certificate

16.3.2. Setting up your provisioning profile

16.3.3. The code for handling push notifications

16.3.4. Preparing audio files

16.4. Creating a push notification provider in PHP

16.4.1. Creating the SSL certificate

16.4.2. Implementing the PHP push notification provider

16.5. Summary

Chapter 17. The Map Kit framework

17.1. Overview of Map Kit

17.2. Adding a map to an application

17.2.1. Adding the map using Interface Builder

17.2.2. Adding the map programmatically

17.2.3. Controlling the map

17.3. Reverse geocoding

17.4. Annotating the map

17.4.1. Adding basic map annotations

17.4.2. Adding custom map annotations

17.5. Summary

Chapter 18. In-app purchasing using Store Kit

18.1. Setting up a sandbox testing environment

18.1.1. Creating an iTunes test user

18.1.2. Adding products

18.2. Creating a simple store interface

18.3. Summary

Chapter 19. iPhone SDK enhancements

19.1. Custom keyboard accessories

19.1.1. Extending UITextField

19.1.2. Implementing the custom UITextField

19.1.3. Custom keyboards

19.2. Going forward: the iPhone 4.0 SDK

19.2.1. Multitasking

19.2.2. User experience enhancements

19.2.3. Multimedia framework enhancements

19.2.4. Game Center

19.3. Summary

Appendix A. iPhone OS class reference

A.1. UIKit framework classes

A.2. Foundation framework classes

A.3. Other classes

Appendix B. External sources and references

General resources

SDK resources

Other technologies

Appendix C. Publishing your SDK program

C.1. Signing up with Apple

C.2. Compiling to the device

C.3. Preparing for distribution via the App Store

Appendix D. Updating current applications for the iPad

D.1. Configuring Xcode

D.2. Updating Info.plist to support multiple orientations

D.3. Adding iPad-specific interface components

D.4. Updating your views for the iPad

D.5. Adding multiple-orientation support

Index

List of Figures

List of Tables

List of Listings

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset