iPhone SDK Development
Dec 08, 2009—
Examples for every iPhone feature
‘iPhone SDK Development’ by Bill Dudney and Chris Adamson is one of the ‘third wave’ of iPhone programming books, and an excellent tour of Cocoa Touch and Xcode — the libraries and IDE for iPhone programming.
The book assumes that you have some experience with C and/or an object-oriented language. You’re expected to know what pointers and arrays are, and the control structures (for loops, if and switch statements) that are common to most curly-brace languages. This is the Achilles heel of most iPhone and Cocoa books — they assume you have a C or OOP background. In this case the litmus test is page 27 — read that one in the bookstore, and if it makes no sense, put the book back.
‘iPhone SDK Development’ begins with Hello World, of course, and the default iPhone app template. Many parts of the default template are created automatically, so it’s great to have its innards dissected and labeled. This is follow by an exploration of views, tables, and controllers. The examples were created with the latest (3.x) version of the iPhone SDK, so you can be assured that the sample code works without needing modification.
Far from being just a recipe book, each example comes with an explanation of how the code works. The authors deftly detail topics that confuse new iPhone programmers, like memory management and properties; they also provide working code for problems that have puzzled iPhone message boards in the past, like creating custom table cells from a
‘iPhone SDK Development’ is not aimed primarily at game developers — the only game related sample code is a multi-player tapping game in the P2P networking chapter — but it does include overviews and code samples for the technologies that game programmers will be interested in such as audio sessions, Animation, the accelerometer, GPS, and the compass. There are also four pages sketching out a skeleton for OpenGL before directing you to the OpenGL SuperBible for more information.
The chapters on data storage cover the whole gamut of options — flat files, plists, straight SQLite, and core data. The networking chapters begin by creating a simple web browser before diving into HTTPS, XML parsing, and peer-to-peer networking with Bonjour and Game Kit.
From there the authors cover multimedia topics including video playback, access to the iPod library and multiple methods of audio playback and recording, multi-touch controls, the camera, the address book, and the Map Kit.
The last three chapters — on debugging, performance tuning, and the ins and outs of publishing on the app store — round out the book nicely.
Organization and Layout
The long-term value of a technical books hinges on its index, and the index is strong with this one. If doesn’t include every keyword used in the program listings, but it is otherwise comprehensive and useful. This fits with the structure of the book which is a series of examples, not a reference guide or a rehash of Apple’s docs.
Every program listing begins with a gray bar at the top telling you which file the code belongs in — a nice touch that renders multi-file examples more understandable. The use of boldface in the program listings was inconsistent though, and distracting until I learned to ignore it. The rest of the layout was clear and unobtrusive, with many screen shots for Interface Builder operations in particular.
The authors clearly know their stuff, and no technical flaws were evident. They could have accurately added advanced to the title — this is not a book for novice coders, and contains a lot of information that was missing from Apple’s docs and only available in message boards. It’s also one of the most up-to-date iPhone books I’ve read, with information on the 3GS device and the new static analyzer.
For anyone who’s done some Mac OS X or iPhone programming before, or with experience in another object-oriented language, the book is a perfect fit with lots of example code for every iPhone feature.
- Hello iPhone
- iPhone Development Fundamentals
- View Controllers
- Table Views excerpt
- Tab Bar Controllers
- File I/O
- The SQLite Database
- Core Data excerpt
- Connecting to the Internet
- Peer-to-peer Networking excerpt
- Video Playback
- iPod Library Access
- Playing and Recording Audio
- Core Audio
- Events, Multi Touch and Gestures
- Drawing in Custom Views
- Drawing Images and Photos
- Core Animation
- Address Book
- iPhone Location API
- Map Kit excerpt
- Application Integration
- Performance Tuning
- Before and After