Table of Contents

Copyright

Brief Table of Contents

Table of Contents

List of Figures

List of Tables

List of Listings

Preface

Acknowledgments

About this book

1. Introducing iPhone programming

Chapter 1. Introducing the iPhone

1.1. iPhone core specifications

1.1.1. iPhone input and output specifications

1.1.2. iPhone network specifications

1.1.3. iPhone browser specifications

1.1.4. Other iPhone hardware features

1.2. How the iPhone compares to the industry

1.2.1. The physical comparison

1.2.2. Competitive internet viewing

1.2.3. Mobile web standards

1.2.4. The rest of the story

1.3. How the iPhone is unique

1.4. Understanding iPhone input and output

1.4.1. Output and iPhone viewport

1.4.2. Output and orientations

1.4.3. Input and iPhone mousing

1.5. Summary

Chapter 2. Web development or the SDK?

2.1. Comparing the two programming styles

2.2. A central philosophy: the continuum of programming

2.3. Advantages and disadvantages

2.3.1. Web development

2.3.2. SDK development

2.3.3. To each program its platform

2.4. Stand-alone iPhone development

2.4.1. Web development models

2.4.2. SDK development models

2.5. Integrated iPhone development

2.5.1. Mirrored development

2.5.2. Mixed development

2.5.3. Client-server development

2.5.4. Last thoughts on integration

2.6. Summary

2. Designing web pages for the iPhone

Chapter 3. Redeveloping web pages for the iPhone

3.1. The iPhone viewport

3.1.1. Making sitewide viewport changes

3.1.2. Making local viewport changes

3.1.3. Viewport properties and constants

3.2. Making your web pages iPhone friendly

3.2.1. Avoiding missing iPhone functionality

3.2.2. Creating good links

3.2.3. Practicing good web work

3.2.4. Fixing common problems

3.3. Making your web pages iPhone optimized

3.3.1. Detecting the iPhone through USER_AGENT

3.3.2. Detecting the iPhone through CSS

3.3.3. Optimizing with CSS

3.4. Manipulating iPhone chrome

3.4.1. The three bars

3.4.2. Web clips

3.5. Capturing iPhone events

3.5.1. One-fingered touches

3.5.2. Two-fingered gestures

3.6. Redisplaying web pages

3.6.1. The Gmail iPhone pages

3.6.2. The Facebook iPhone pages

3.7. Supporting non-iPhone users

3.8. Summary

Chapter 4. Advanced WebKit and textual web apps

4.1. Introducing the WebKit

4.1.1. New HTML elements

4.1.2. New CSS elements

4.2. CSS transforms, transitions, and animations

4.2.1. The transform function

4.2.2. The transition function

4.2.3. The animation function

4.3. The WebKit database

4.3.1. Loading a database

4.3.2. Running a transaction

4.3.3. A sample database

4.4. Adjusting the chrome

4.5. Recognizing touches and gestures

4.5.1. Accessing events

4.5.2. Converting events

4.5.3. Accessing touches

4.5.4. Accessing gestures

4.6. Recognizing orientation

4.7. Upcoming features: CSS gradients and masks

4.7.1. CSS gradients

4.7.2. CSS masks

4.7.3. The Canvas alternative

4.8. Summary

Chapter 5. Using iUI for web apps

5.1. Creating your own iPhone UI

5.1.1. The graphical interface

5.1.2. The iPhone data paradigm

5.1.3. Other iPhone design elements

5.2. Getting ready for iUI

5.3. Developing with iUI

5.3.1. The iUI toolbar

5.3.2. iUI lists

5.3.3. iUI dialogs

5.3.4. iUI searches done right with Ajax

5.3.5. iUI panels and rows

5.3.6. iUI buttons

5.3.7. iUI attributes

5.4. Creating an iUI back end

5.5. Other iUI tips and tricks

5.5.1. Organizing your code

5.5.2. Improving data listings

5.5.3. Compressing iUI

5.5.4. Selecting a different look

5.6. Integrating iUI with other libraries

5.6.1. Using jQuery with iUI

5.6.2. Using iUI with WebKit

5.7. Summary

Chapter 6. Using Canvas for web apps

6.1. Getting ready for Canvas

6.1.1. Enabling Canvas

6.1.2. Ensuring compatibility

6.1.3. Putting it together

6.2. Drawing paths

6.2.1. Basic path commands

6.2.2. Curve commands

6.3. Drawing shapes

6.3.1. Drawing rectangles

6.3.2. Writing shape functions

6.4. Creating styles: colors, gradients, and lines

6.4.1. Color styles

6.4.2. Gradient styles

6.4.3. Line styles

6.5. Modifying composition and clipping

6.5.1. Global variables

6.5.2. Clipping paths

6.6. Transforming and restoring

6.6.1. Transformations

6.6.2. State stacking

6.7. Incorporating images, patterns, and text

6.7.1. Image commands

6.7.2. Pattern commands

6.7.3. Text commands

6.8. Putting it together

6.9. Applying animation

6.10. Summary

Chapter 7. Building web apps with Dashcode

7.1. An introduction to Dashcode

7.1.1. Starting a Dashcode project

7.1.2. The anatomy of Dashcode

7.1.3. Running Dashcode projects

7.1.4. Deploying Dashcode projects

7.2. Writing Dashcode programs

7.2.1. Using library parts

7.2.2. Adding action buttons

7.2.3. Using the list-based Browser template

7.2.4. Working with the stackLayout part

7.2.5. Exploring the rest of Dashcode

7.3. Integrating Dashcode with existing libraries

7.3.1. Integrating Dashcode with WebKit

7.3.2. Integrating Dashcode with iUI

7.3.3. Integrating Dashcode with Canvas

7.3.4. Deeper integration

7.4. Summary

Chapter 8. Debugging iPhone web pages

8.1. Using Apache locally

8.2. Debugging with your desktop browser

8.2.1. Using Safari

8.2.2. Using Firefox

8.2.3. Using the iPhone Simulator

8.3. Debugging with your iPhone

8.3.1. Using iPhone Debug

8.3.2. Using bookmarklets

8.4. Profiling for the iPhone

8.5. Summary

Chapter 9. SDK programming for web developers

9.1. An introduction to C’s concepts

9.1.1. Declarations and typing

9.1.2. Memory management and pointers

9.1.3. File structure and directives

9.1.4. Compiling

9.1.5. Other elements

9.2. An introduction to object-oriented programming

9.2.1. Objects and classes

9.2.2. Messaging

9.3. The Model-View-Controller (MVC) pattern

9.4. Summary

3. Learning SDK fundamentals

Chapter 10. Learning Objective-C and the iPhone OS

10.1. Getting ready for the SDK

10.1.1. Installing the SDK

10.1.2. The anatomy of the SDK

10.2. Introducing Objective-C

10.2.1. The big picture

10.2.2. The message

10.2.3. Class definition

10.2.4. Properties

10.2.5. Other compiler directives

10.2.6. Categories and protocols

10.2.7. Wrapping up Objective-C

10.3. Introducing the iPhone OS

10.3.1. The anatomy of the iPhone OS

10.3.2. The hierarchy of the iPhone’s objects

10.3.2. Windows and views

10.4. The iPhone OS’s methods

10.4.1. Object creation

10.4.2. Memory management

10.4.3. Event response

10.4.4. Life-cycle management

10.5. Summary

Chapter 11. Using Xcode

11.1. Introducing Xcode

11.1.1. The anatomy of Xcode

11.1.2. Compiling and executing in Xcode

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

11.2.1. Understanding main.m

11.2.2. Understanding the application delegate

11.2.3. Writing Hello, World!

11.3. Creating a new class in Xcode

11.3.1. The new class how-to

11.3.2. The header file

11.3.3. The source code file

11.3.4. Linking it in

11.4. Other Xcode functionality

11.4.1. Adding frameworks with Xcode

11.4.2. Using alternate templates with Xcode

11.4.3. Xcode tips and tricks

11.5. Summary

Chapter 12. Using Interface Builder

12.1. An introduction to Interface Builder

12.1.1. The anatomy of Interface Builder

12.1.2. Simulating in Interface Builder

12.2. Creating a first project in Interface Builder: pictures and the web

12.2.1. Creating new objects

12.2.2. Manipulating objects graphically

12.2.3. Using the inspector window

12.2.4. Working with pictures

12.3. Building connections in Interface Builder

12.3.1. Declaring an IBOutlet

12.3.2. Connecting an object

12.3.3. Coding with IBOutlets

12.4. Other Interface Builder functionality

12.4.1. Building other connections

12.4.2. Creating external objects

12.4.3. Initializing Interface Builder objects

12.4.4. Accessing .xib files

12.4.5. Creating new .xib files

12.5. Summary

Chapter 13. Creating basic view controllers

13.1. The view controller family

13.2. The bare view controller

13.2.1. The anatomy of a view controller

13.2.2. Creating a view controller

13.2.3. Building up a view controller interface

13.2.4. Using your view controller

13.3. The table view controller

13.3.1. The anatomy of a table view controller

13.3.2. Creating a table view controller

13.3.3. Building up a table interface

13.3.4. Using your table view controller

13.4. Summary

Chapter 14. Monitoring events and actions

14.1. An introduction to events

14.1.1. The responder chain

14.1.2. Touches and events

14.2. A touching example: the event reporter

14.2.1. Setting things up in Interface Builder

14.2.2. Preparing a view for touches

14.2.3. Controlling your events

14.3. Other event functionality

14.3.1. Regulating events

14.3.2. Other event methods and properties

14.4. An introduction to actions

14.4.1. The UIControl object

14.4.2. Control events and actions

14.4.3. The addTarget:action:forControlEvents: method

14.5. Adding a button to an application

14.5.1. Using addTarget:action:forControlEvents:

14.5.2. Using an IBAction

14.6. Other action functionality

14.6.1. The UITextField

14.6.2. The UISlider

14.6.3. A TextField/Slider mashup

14.6.4. Actions made easy

14.6.5. Actions in use

14.7. Introducing notifications

14.8. Summary

Chapter 15. Creating advanced view controllers

15.1. The tab bar view controller

15.1.1. The anatomy of a tab bar controller

15.1.2. Creating a tab bar controller

15.1.3. Building a tab bar interface

15.1.4. Using your tab bar controller

15.2. The navigation controller

15.2.1. The anatomy of a navigation controller

15.2.2. Creating a navigation controller

15.2.3. Building a navigation controller

15.2.4. Using your navigation controller

15.3. Using the flipside controller

15.4. Modal view controllers

15.5. Summary

4. Programming with the SDK Toolkit

Chapter 16. Data: actions, preferences, files, SQLite, and addresses

16.1. Accepting user actions

16.2. Maintaining user preferences

16.2.1. Creating your own preferences

16.2.2. Using the system settings

16.3. Opening files

16.3.1. Accessing your bundle

16.3.2. Accessing other directories

16.3.3. Manipulating files

16.3.4. Filesaver: a UITextView example

16.4. Using SQLite

16.4.1. Setting up an SQLite database

16.4.2. Accessing SQLite

16.4.3. Accessing your SQLite database

16.4.4. Building a navigation menu from a database

16.4.5. Expanding this example

16.5. Accessing the Address Book

16.5.1. An overview of the frameworks

16.5.2. Accessing Address Book properties

16.5.3. Querying the Address Book

16.5.4. Using the Address Book UI

16.6. Summary

Chapter 17. Positioning: accelerometers and location

17.1. The accelerometer and orientation

17.1.1. The orientation property

17.1.2. The orientation notification

17.2. The accelerometer and movement

17.2.1. Accessing the UIAccelerometer

17.2.2. Parsing the UIAcceleration

17.2.3. Checking for gravity

17.2.4. Checking for movement

17.2.5. Recognizing simple accelerometer movement

17.3. The accelerometer and gestures

17.4. All about Core Location

17.4.1. The location classes

17.4.2. An example using location and distance

17.4.3. An example using altitude

17.4.4. Core Location and the Internet

17.5. Summary

Chapter 18. Media: images and sounds

18.1. An introduction to images

18.1.1. Loading a UIImage

18.1.2. Drawing a UIImageView

18.1.3. Modifying an image in the UIKit

18.2. Drawing simple images with Core Graphics

18.3. Accessing photos

18.3.1. Using the image picker

18.3.2. Taking photos

18.3.3. Saving to the photo album

18.4. Collage: an image example

18.4.1. The collage view controller

18.4.2. The collage temporary image view

18.4.3. The collage view

18.4.4. Expanding on this example

18.5. Using the Media Player framework

18.5.1. The media player class

18.5.2. The volume view

18.5.3. Better integrating the media player

18.6. Playing sounds manually

18.6.1. Playing simple sounds

18.6.2. Vibrating the iPhone

18.6.3. Playing complex sounds

18.6.4. Other audio frameworks

18.7. Summary

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

19.1. An introduction to Quartz 2D

19.2. The Quartz context

19.2.1. Drawing to a UIView

19.2.2. Drawing to a bitmap

19.3. Drawing paths

19.3.1. Finishing a path

19.3.2. Creating reusable paths

19.3.3. Drawing rectangles

19.4. Setting the graphic state

19.4.1. Setting colors

19.4.2. Making transformations

19.4.3. Setting clipping paths

19.4.4. Other settings

19.4.5. Managing the state

19.5. Advanced drawing in Quartz

19.5.1. Drawing gradients

19.5.2. Drawing images

19.5.3. Drawing words

19.5.4. What we didn’t cover

19.6. Drawing on a picture: an example

19.6.1. The photodraw view controller

19.6.2. The photodraw view

19.6.3. Expanding on the example

19.7. An introduction to Core Animation

19.7.1. The fundamentals of Core Animation

19.7.2. Getting started with Core Animation

19.7.3. Drawing a simple implicit animation

19.7.4. Drawing a simple explicit animation

19.8. An introduction to OpenGL

19.9. Summary

Chapter 20. The web: web views and internet protocols

20.1. The hierarchy of the internet

20.2. Low-level networking

20.2.1. The CFHost class

20.3. Working with URLs

20.3.1. Creating an NSURL

20.3.2. Building an NSURLRequest

20.3.3. Manipulating HTML data by hand

20.4. Using UIWebView

20.4.1. Calling up the web view

20.4.2. Managing the web view delegate

20.4.3. Thumbnails: a web view example

20.4.4. Google Maps: a Core Location example

20.5. Parsing XML

20.5.1. Starting up NSXMLParser

20.5.2. Acting as a delegate

20.5.3. Building a sample RSS reader: an XML example

20.5.4. Altitude redux: a Core Location example

20.6. POSTing to the web

20.6.1. POSTing by hand

20.6.2. Submitting forms

20.7. Accessing the social web

20.7.1. Using web protocols

20.7.2. Using TouchJSON

20.8. 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

B.1 General resources

B.2 Web app resources

B.3 SDK resources

B.4 Other technologies

Appendix C. Publishing your SDK program

C.1 Signing up with Apple

C.2 Compiling to the iPhone

C.3 Preparing for distribution via the iPhone App Store

Index

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

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