You are previewing iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch.
O'Reilly logo
iPhone SDK Programming: Developing Mobile Applications for Apple iPhone and iPod touch

Book Description

With iPhone SDK Programming, developers have the expert guidance they need to begin building native applications for Apple's new iPhone 3G as well as the iPod touch. Inside, veteran mobile developer and Bell Labs scientist Maher Ali begins with a foundational introduction to Objective C and Cocoa programming, and then guides you through the building programs with Apple's iPhone SDK.

iPhone SDK Programming covers a wide range of topics, including:

  • The Objective-C programming language

  • Collections

  • Cocoa Touch

  • Building advanced mobile user interfaces

  • Core Animation and Quartz 2D

  • Model-View-Controller (MVC) designs

  • Table Views File management

  • Parsing XML documents using SAX and DOM

  • Working with Google Maps API

  • Consuming REST Web Services

  • Building advanced location-based applications

  • Developing database applications using the SQLite engine

  • Building Multimedia applications

  • Making use of the camera and video Working with the accelerometer

Table of Contents

  1. Copyright
  2. PREFACE
    1. Is this book for you?
    2. What else do you need?
    3. Organization
  3. 1. Objective-C and Cocoa
    1. 1.1. Classes
      1. 1.1.1. Class declaration
      2. 1.1.2. How do I use other declarations?
      3. 1.1.3. Class definition
      4. 1.1.4. Method definition and invocation
      5. 1.1.5. Important types
      6. 1.1.6. Important Cocoa classes
    2. 1.2. Memory Management
    3. 1.3. Protocols
    4. 1.4. Properties
    5. 1.5. Categories
    6. 1.6. Posing
    7. 1.7. Exceptions and Errors
      1. 1.7.1. Exceptions
        1. 1.7.1.1. Nesting exceptions
      2. 1.7.2. Errors
        1. 1.7.2.1. Creating an NSError instance
    8. 1.8. Key-value coding (KVC)
      1. 1.8.1. An example illustrating KVC
    9. 1.9. Multithreading
    10. 1.10. Summary
    11. 1.11. Problems
  4. 2. Collections
    1. 2.1. Arrays
      1. 2.1.1. Immutable copy
      2. 2.1.2. Mutable copy
      3. 2.1.3. Deep copy
      4. 2.1.4. Sorting an array
    2. 2.2. Sets
      1. 2.2.1. Immutable sets
      2. 2.2.2. Mutable sets
      3. 2.2.3. Additional important methods
    3. 2.3. Dictionaries
      1. 2.3.1. Additional important methods
    4. 2.4. Summary
  5. 3. Anatomy of an iPhone Application
    1. 3.1. HelloWorld Application
    2. 3.2. Building the HelloWorld Application
  6. 4. The View
    1. 4.1. View Geometry
      1. 4.1.1. Useful geometric type definitions
      2. 4.1.2. The UIScreen class
      3. 4.1.3. The frame and center properties
      4. 4.1.4. The bounds property
    2. 4.2. The View Hierarchy
    3. 4.3. The Multitouch Interface
      1. 4.3.1. The UITouch class
      2. 4.3.2. The UIEvent class
      3. 4.3.3. The UIResponder class
      4. 4.3.4. Handling a swipe
      5. 4.3.5. More advanced gesture recognition
    4. 4.4. Animation
      1. 4.4.1. Using the UIView class animation support
      2. 4.4.2. Transition animation
    5. 4.5. Drawing
  7. 5. Controls
    1. 5.1. The Foundation of All Controls
      1. 5.1.1. UIControl attributes
      2. 5.1.2. Target-action mechanism
    2. 5.2. UITextField
      1. 5.2.1. Interacting with the keyboard
      2. 5.2.2. The delegate
      3. 5.2.3. Creating of, and working with, a UITextField
    3. 5.3. Sliders
    4. 5.4. Switches
    5. 5.5. Buttons
    6. 5.6. Segmented Controls
    7. 5.7. Page Controls
    8. 5.8. Date Pickers
    9. 5.9. Summary
  8. 6. View Controllers
    1. 6.1. The Simplest View Controller
      1. 6.1.1. The view controller
      2. 6.1.2. The view
      3. 6.1.3. The application delegate
      4. 6.1.4. Summary
    2. 6.2. Radio Interfaces
      1. 6.2.1. A detailed example
      2. 6.2.2. Some comments on tab bar controllers
    3. 6.3. Navigation Controllers
      1. 6.3.1. A detailed example
        1. 6.3.1.1. The view controller
        2. 6.3.1.2. The view
        3. 6.3.1.3. The application delegate
      2. 6.3.2. Customization
        1. 6.3.2.1. Navigation item
    4. 6.4. Modal View Controllers
      1. 6.4.1. A detailed example
    5. 6.5. Summary
  9. 7. Special-Purpose Views
    1. 7.1. Picker View
      1. 7.1.1. The delegate
      2. 7.1.2. An example
    2. 7.2. Progress Views
      1. 7.2.1. An example
    3. 7.3. Text View
      1. 7.3.1. The delegate
      2. 7.3.2. An example
    4. 7.4. Alert View
    5. 7.5. Action Sheet
    6. 7.6. Web View
      1. 7.6.1. A simple web view application
      2. 7.6.2. Viewing local files
      3. 7.6.3. Evaluating Javascript
      4. 7.6.4. The web view delegate
  10. 8. Table View
    1. 8.1. Overview
    2. 8.2. The Simplest Table View Application
    3. 8.3. A Table View with both Images and Text
    4. 8.4. A Table View with Sections Headers and Footers
    5. 8.5. A Table View with the Ability to Delete Rows
    6. 8.6. A Table View with the Ability to Insert Rows
    7. 8.7. Reordering Table Rows
    8. 8.8. Presenting Hierarchical Information
      1. 8.8.1. Detailed example
    9. 8.9. Grouped Table Views
    10. 8.10. Indexed Table Views
    11. 8.11. Summary
  11. 9. File Management
    1. 9.1. The Home Directory
    2. 9.2. Enumerating a Directory
    3. 9.3. Creating and Deleting a Directory
    4. 9.4. Creating Files
    5. 9.5. Retrieving and Changing Attributes
    6. 9.6. Working with Resources and Low-Level File Access
    7. 9.7. Summary
  12. 10. Working with Databases
    1. 10.1. Basic Database Operations
    2. 10.2. Processing Row Results
    3. 10.3. Prepared Statements
      1. 10.3.1. Preparation
      2. 10.3.2. Execution
      3. 10.3.3. Finalization
    4. 10.4. User-defined Functions
    5. 10.5. Storing BLOBs
    6. 10.6. Retrieving BLOBs
    7. 10.7. Summary
  13. 11. XML Processing
    1. 11.1. XML and RSS
      1. 11.1.1. XML
      2. 11.1.2. RSS
    2. 11.2. Document Object Model (DOM)
    3. 11.3. Simple API for XML (SAX)
    4. 11.4. An RSS Reader Application
    5. 11.5. Summary
    6. 11.6. Problems
  14. 12. Location Awareness
    1. 12.1. The Core Location Framework
      1. 12.1.1. The CLLocation class
    2. 12.2. A Simple Location-aware Application
    3. 12.3. Google Maps API
      1. 12.3.1. A geocoding application
    4. 12.4. A Tracking Application with Maps
    5. 12.5. Working with ZIP Codes
    6. 12.6. Summary
  15. 13. Working with Devices
    1. 13.1. Working with the Accelerometer
      1. 13.1.1. Example
    2. 13.2. Audio
      1. 13.2.1. Example
    3. 13.3. Video
    4. 13.4. Device Information
    5. 13.5. Taking and Selecting Pictures
      1. 13.5.1. Overall approach
      2. 13.5.2. Detailed example
    6. 13.6. Summary
  16. A. Saving and Restoring App State
  17. B. Invoking External Applications
  18. REFERENCES AND BIBLIOGRAPHY
    1. Bibliography