There are two approaches to learning the ins and outs of writing iOS apps. One can trudge through Apple Documentation, which consists of class documents and guides to the numerous frameworks and concepts that underlythe platform, or one can find a kick-ass book that walks through the process in a logical order and holds your hand all the way. If you’re lucky, you can do both, using the book as your base, your safe harbour, and then delving into the documentation on an as-needed basis. There’s nothing wrong with the Apple Documentation. In fact, it’s really good, and I couldn’t imagine writing iOS apps without it. But it’s still nice to have someone to offer you wise advice and occasionally wipe the tears of frustration from your face. That’s where Matt Neuburg comes in. More specifically, that’s where Neuburg’s tome, Programming iOS 4, enters the story. Published in June 2011, it’s one of the newest and most complete introductions to the iOS platform on the shelves.
If you want your hand held, but you don’t want to be treated like a child, this is your book. Programming iOS 4 starts right at the beginning, with the C language, which forms the basis for Objective-C. From there, he gently introduces (or reviews) some object-oriented programming topics before moving into the details of the Objective-C language. I am impressed with his approach and organization in chapters 4 and 5, in which he discusses separately Classes and Instances. In my experience, this is a novel approach to explaining Classes in the language, and I found it incredibly clear and helpful.
From there, he tackles the IDE: XCode. The standout chapter in this part of the book is Chapter 7: Nib Management, in which Neuburg not only describes the Nib loading process, but takes the reader into the guts of the process and attempts to reveal the dark sorcery that goes on behind the scenes. The standard approach is to simply describe how to connect outlets to code and ask the reader to accept the opaque nature of the underlying process. The rational for glossing over the details is to get the reader into building a useful project quickly before their interest wanes. Neuburg instead takes a more principled approach and works to build a strong base of understanding before launching into the “fun stuff”.
This approach follows consistently through the rest of the book, and if I have any complaints, it comes from this strategy. We are at page 125 before we learn about Nibs, and we are shielded from the evils of memory management until Chapter 12 (page 249). We are guided through Cocoa classes, events, memory management, accessors. Then views, custom drawing, layers, animation and touch handling. And only then, after we have all those building blocks in place, are we introduced to View Controllers, which form the foundation of nearly all non-game iOS apps. Chapter 19: View Controllers starts on page 435, which if I were an eager, would-be iOS developer, would require an heroic demonstration of patience and perseverance to wait for. Every Cocoa Touch app XCode template uses a View Controller as the basis of the app’s architecture, and having to trudge through 400 pages to get to this “good stuff” seems like a lot to ask. I’m not suggesting this is the wrong approach. On the contrary, I think it’s a brilliant way of building a solid foundation in the framework before getting to the magic classes that give us so much for free. It simply asks a lot of the reader and hopeful iOS developer.
Weighing in at over 800 pages and being so well-organized and thorough, Programming iOS 4 represents the best on offer, both for introductions to the platform and as a reference guide to nearly every basic component in the app development process. As you can imagine, it took a long time to put this book together, and Neuburg admits in the text that when he began writing, iOS was at version 3.1. A lot changed in that time, and the author studiously followed along and ensured the latest features of iOS 4 and especially of XCode 4 were included in the book. A side effect however, is that some chapters feel like they have unnecessary code examples that demonstrate the “old way” of performing some tasks, when simply showing the “new way” would have sufficed.
On the whole, I am extremely impressed with this book and I will be recommending it to my students in the iOS courses I teach. My complaints are minor, and I only include them here for completeness and in order to have something more to write than simply expressing how great the book is. The tragedy is that despite how new and complete this book is, portions of it are bound to be obsolete within a few short months when iOS 5 ships. We can only hope that Neuburg will once again be there to update his oeuvre and guide us into the brave new world of Automatic Reference Counting, iCloud, and all the other curves Apple decides to through our way this fall.