iOS SDK Development
by Chris Adamson, Bill Dudney
Version: P1.0 (November 2012)
Copyright 2012 The Pragmatic Programmers, LLC. This book is licensed tothe individual who purchased it. We don't copy-protect itbecause that would limit your ability to use it for yourown purposes. Please don't break this trustyou can use this across all of your devices but please do not share this copywith other members of your team, with friends, or via file sharing services. Thanks.
Dave & Andy.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and The Pragmatic Programmers, LLC was aware of a trademark claim, the designations have been printed in initial capital letters or in all capitals. The Pragmatic Starter Kit, The Pragmatic Programmer, Pragmatic Programming, Pragmatic Bookshelf and the linking g device are trademarks of The Pragmatic Programmers, LLC.
Every precaution was taken in the preparation of this book. However, the publisher assumes no responsibility for errors or omissions, or for damages that may result from the use of information (including program listings) contained herein.
Our Pragmatic courses, workshops, and other products can help you and your team create better software and have more fun. For more information, as well as the latest Pragmatic titles, please visit us at http://pragprog.com.
Table of Contents
Copyright 2012, The Pragmatic Bookshelf.
What readers are saying about iOS SDK Development
Being a successful iOS developer means maintaining laser-like focus on the details that are specific to your app. The best way to do this is to write as little code as possible. Apples frameworks provide an incredible starting point, but you have to understand what they do, how they work, and why theyre designed the way they are. I can scarcely think of anyone more qualified to teach you the ins and outs of Apples iOS SDK than Bill Dudney and Chris Adamson. Their all-new, updated book, iOS SDK Development , is a must-read, plain and simple.
John C. Fox |
Creator of MemoryMiner and Co-Host, iDeveloper Live |
A programmer looking to branch out into iPhone or iPad development couldnt ask for a better guide to getting started. Chris and Bill are excellent teachers, and that really comes through in these pages.
Dave Klein |
Founder of CocoaConf andAuthor of Grails: A Quick-Start Guide |
Never have I read an iOS book that so thoroughly guides the reader through the development cycle of an iOS app. I recommend this book to anyone learning the iOS platform.
In short, this is one of the best iOS books I have read. It might require some outside homework for someone totally new to programming, but most people coming to iOS will be existing developers (like me) that are getting sick of PHP and .NET.
Acknowledgments
This book starts with all the people who asked for it. The relevance and accuracy of our previous edition, iPhone SDK Development, diminished as Apple piled on language innovations like blocks, tool changes like Xcode 4, and all sorts of neat stuff to play with. Readers of the first edition wondered when wed get an update out, or theyd send us screenshots of Xcode 4 and say, How do I make my windows look like the screenshots in your book? It didnt take long for us to think that our old book was doing a disservice to new readers and cried out for a up-to-date do-over.
Writing a book is a huge undertaking. But of course its not just the authors that worked hard. Our editor, Brian Hogan, was an invaluable partner in the tasks of bringing this book home with just the right amount of encouragement and chiding to get us over the hump and of rescuing this book when we were foolishly targeting two different audiences and not reaching either of them. So thanks to Brian for his work throughout this process and converting sometimes-messy prose into something our readers could understand.
We have a number of individual thanks to hand out in this edition. Jonathan Penn turned us onto UI Automation testing (covered in Section 9.3, Hes a designer-turned-programmer (with the help of the Pragmatic Studios iOS programming courses), and youll see his pixels near the end of the book.
From Chris Adamson
Its been comfortable working again with the Prags and their innovative and practical publishing system. Buildingand more importantly, updatingprogramming books with this system is a breeze, and writing markup is second nature to developers like us. For what its worth, I wrote a bunch of my stuff on an iPad at a standing desk with a dock keyboard and the Textastic app (http://www.textasticapp.com). Its inspiring to think that were writing about how to build the tools we use every day; maybe someone reading this book will write my next favorite app.
Im grateful to my family for putting up with both my absence and my stress through one more book and to all the readers of the first edition who wrote in or posted on the forums as they got their first apps up on the store. Thats the kind of thrill that keeps us going.
Obligatory end-of-book tune check: this time it was Sarah Slean, Rich Aucoin, Coeur de Pirate, Fitz and the Tantrums, and Metric. Up-to-date stats at http://www.last.fm/user/invalidname.
From Bill Dudney
Id like to thank the many folks who have been to the Pragmatic iOS Studios (http://pragmaticstudio.com/ios). Your questions, insights, and struggles have been an inspiration for much of the material in this book. I always love walking into a class early on the first day and feeling the energy of people excited to learn something new. Listening to the questions and watching the victories helped me immensely in understanding how to present iOS to developers new to the platform.
Any mention of the Studios requires a heartfelt thanks to my co-teachers, Daniel Steinberg and Matt Drance. I learn something new every time I deliver the class with them.
My family put up with a distracted father and husband all too often throughout the writing of this book. But Id like to say a special thanks to my wife, Sarah, for all her help in editing my first, second, and all-too-often third drafts. Id also like to thank a 2,000-year-old Jewish carpenter for touching my life and making it so much more than it might have been.
From Both of Us
Finally, wed both like to thank Steve Jobs for having given up so much of his life to pursue something he believed in. Computers should be easy to use. He inspired a team of brilliant people to work beyond what they ever thought they could do. And they delivered some great things: the Macintosh in 1984, the NeXT in 1988, the iMac in 1998, and the iPhone in 2007. He did not settle for anyone doing less than his or her best. He was one of a kind and the world is a brighter place for him having been in it.
Some people ask us if the gold rush is over. As Bill always says, its just beginning, but instead of a gold rush we are in the midst of another economic revolution. iOS, and therefore mobile, is defining a whole new way that we can use computers to keep us better connected to things that matter. Even with 700,000-plus apps in the store, we have only begun to scratch the surface of what is possible. The iOS platform is crying out for you to make something spectacularplease let us know when you do!