Back when the iPhone SDK was still a gleam in Mr. Job’s eye, the bookstore’s shelves were devoid of programming books for the iPhone. Now, you need a wheelbarrow to carry all of them home. The increase in the number of books is great news for developers—learning a new platform can be more than a little daunting. But it also means that you have to spend time finding the books that are right for you. If you are considering developing for the iPhone, here are three subjects you need to know about:
- The Objective-C programming language
- The Cocoa Touch framework and the iPhone SDK
- The Xcode development tools
I’ve managed to look through most of the books available on the first two subjects, and provide brief reviews of my favorites in this article. I do not include reviews of the Xcode-related titles, but there are a growing number of books available on this subject, and all of them seem to be pretty good. (Note that the iPhone and iPod touch are practically identical from the programmer’s point of view. References for iPhone development apply equally well to the iPod touch.)
Programming in Objective-C 2.0 (2nd Edition)
Price: $44.99 Author: Stephen G. Kochan; Publisher: Addison Wesley;
Developing applications for the iPhone requires that you learn a new programming language: Objective-C. You might think of it as a cross between C and Smalltalk—it looks quite weird in places and has plenty of [ and ] symbols.
If you are used to C# or Java, you’ll begin to pick it up once you get over the new syntax. Once you do, you’ll be referring to this book time and time again. More than any other on the market, this book focuses on the fundamentals of the language and what you need to know to write efficient, syntactically correct code.
Be sure you pick up the Second Edition of the book because the Objective-C language was updated in the Leopard timescale to include important new features. The Second Edition also includes a brief but useful iPhone development introduction.
Make this one of the first books you add to your library.
Cocoa Programming for Mac OS X (Third Edition)
Price: $49.99 Author: Aaron Hillegass; Publisher: Addison-Wesley;
This book has been the de facto standard reference for Mac programmers for years. It’s not the easiest book to follow in places, but if you stick with it, you’ll have a thorough grounding in Mac and Cocoa development—exactly what you’ll need when you start out writing iPhone applications. Although this book predates iPhone development, it’s an excellent supplement to an iPhone-specific book.
Beginning iPhone Development: Exploring the iPhone SDK
Price: $39.99 Authors: Dave Mark and Jeff LaMarche; Publisher: aPress;
This book is one of my favorites, not because it’s the most detailed reference, but because it’s easy to follow and introduces you to the key programming concepts you’ll need to write iPhone apps. The style is relaxed and non-academic. It’s an excellent “teach yourself” book and great if you don’t know where to start.
I was disappointed that it didn’t touch Core Animation—a key component in iPhone graphics—but it makes up for that weakness with a hugely sensible chapter on localization.
A companion volume covering more advanced topics is promised, and I’ll be first in line to get a copy.
iPhone in Action - Introduction to Web and SDK Development
Price: $39.99 Authors: Christopher Allen and Shannon Appelcline; Publisher: Manning; ISBN: 978-1933988863
This one actually covers two topics: writing native applications and developing Web apps for the iPhone. There’s a lot more to making Web pages look good on the iPhone than you might think. You have to worry about special viewport settings, webkit settings, control using gestures and the touch interface, the iUI and jQuery libraries, and more. Some of this stuff can be hard to track down, but this book makes it easier—it’s a really useful reference.
This book also includes a good introduction to Objective-C and a guide to writing iPhone applications. It’s really a comprehensive piece of work. If you can only afford one book, this would be a good one to get. But I do not consider it a beginner’s guide—you’ll need to have some programming experience to get the most out of it.
iPhone SDK Development
Price: $48.95 (including eBook), $24.00 (eBook only) Authors: Bill Dudney, Marcel Molina, Chris Adamson; Publisher: Pragmatic Programmers; ISBN: 978-1-93435-625-8
I really like the publishing model used by Pragmatic Programmers. Before the physical book is published, you can buy a beta release eBook version, submit feedback and ask for clarification, and get regular updates as the book is finalized.
If you are a little wary of iPhone development, this book is the gentle introduction you’ve been waiting for. It walks you through the confusing topics of View Controllers and Core Animation, and finishes with a look at using Xcode’s performance tuning tools. When you’re finished, you’ll know enough to write some great applications. This book was still in beta when I reviewed it.
Core Animation for Mac OS X and the iPhone
Price: $43.75 (including eBook), $34.95 (paper book only), $22.00 (eBook only)
Author: Bill Dudney; Publisher: Pragmatic Programmers; ISBN: 978-1-93435-610-4
This is the second Pragmatic Programmer’s book in this round-up, but this one is out of beta and available in print format. It focuses on Core Animation, which along with Leopard and the iPhone is a new way of drawing and managing images. I particularly like how it demonstrates 3D graphics by creating a neat version of the Mac’s Front Row interface.
Although the concepts covered in the book are equally applicable to both the Mac and iPhone, there is a section dedicated to developing for the iPhone. Think of this book as dessert after you’ve gotten a grip on Cocoa and Objective-C.
The iPhone Developer’s Cookbook
Price: $31.99 Author: Erica Sadun; Publisher: Addison-Wesley;
There comes a time after a programmer has learned all of the basics when he or she runs into some fiddly little thing they need to do that requires more advanced knowledge. The iPhone Developer’s Cookbook was designed for these situations. It’s stuffed with tasty programming morsels that are just downright useful, and doesn’t attempt to explain everything with pages of sample code. Once you have read the other books listed here and have a few applications under your belt, treat yourself to this one.
When books aren’t enough
Have you ever found yourself in a situation where, no matter how many times you read something, you just don’t understand it? I’ve had that experience with several iPhone programming concepts and was at my wits end until I discovered Pragmatic Programmer’s Screencast series.
I really can’t recommend Bill Dudney’s “Writing Your First iPhone Application” series highly enough. You can watch “Getting Started with Xcode and Interface Builder” for free, and then view the five addotopma; episodes in the series for $5 each. If you prefer to learn by watching and listening rather than reading, visit the Screencast page of the Pragmatic Bookshelf Web site (pragprog.com/screencasts).