Learning iPad Programming
A Hands-On Guide to Building iPad Apps with iOS 5
Kirby Turner
Tom Harrington
Upper Saddle River, NJ Boston Indianapolis San Francisco
New York Toronto Montreal London Munich Paris Madrid
Capetown Sydney Tokyo Singapore Mexico City
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 publisher was aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals.
The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact:
U.S. Corporate and Government Sales
(800) 382-3419
For sales outside the United States, please contact:
International Sales
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data
Turner, Kirby, 1966
Learning iPad programming : a hands-on guide to building iPad apps
with iOS 5 / Kirby Turner, Tom Harrington.
p. cm.
Includes index.
ISBN 978-0-321-75040-2 (pbk. : alk. paper)
1. iPad (Computer)Programming. 2. Application
softwareDevelopment. 3. Mobile computing. 4. Laptop computers. 5.
Macintosh (Computer) 6. iOS (Electronic resource) I. Harrington, Tom.
II. Title.
QA76.8.I863T87 2012
005.258dc23
2011042203
Copyright 2012 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Pearson Education, Inc., Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to (201) 236-3290.
ISBN-13: 978-0-321-75040-2
ISBN-10: 0-321-75040-3
Text printed in the United States on recycled paper at Edwards Brothers in Ann Arbor, Michigan.
Second printing, February 2012
Editor-in-Chief
Mark Taub
Senior Acquisitions Editor
Chuck Toporek
Development Editor
Chuck Toporek
Managing Editor
John Fuller
Project Editor
Anna Popick
Copy Editor
Barbara Wood
Indexer
Ted Laux
Proofreader
Linda Begley
Technical Reviewers
Patrick Burleson
Matt Martel
Erik Price
Mike Shields
Publishing Coordinator
Olivia Basegio
Cover Designer
Chuti Prasertsith
Compositor
Rob Mauhar
Praise for Learning iPad Programming
This amazing, thorough book takes an interesting approach by working through the design and development of a simple, yet realistic iPad app from start to finish. It is refreshing to see a technical book that explains how and why without inundating you with endless toy examples or throwing you into a sea of mind-numbing details. Particularly amazing is that it does this without assuming a large amount of experience at first. Yet it covers advanced topics at sufficient depth and in a logical order for all developers to get plenty of valuable information and insight. Kirby and Tom know this material and have done a great job of introducing the various frameworks and the reasoning behind how, why, and when you would use them. I highly recommend Learning iPad Programming to anyone interested in developing for this amazing platform.
Julio Barros
E-String.com
This is a great introduction to iPad programming with a well-done sample project built throughout. Its great for beginners as well as those familiar with iPhone development looking to learn the differences in developing for the larger screen.
Patrick Burleson
Owner, BitBQ LLC (http://bitbq.com)
Kirby Turner and Tom Harringtons Learning iPad Programming provides a comprehensive introduction to one of todays hottest topics. Its a great read for the aspiring iPad programmer.
Robert Clair
Author, Learning Objective-C 2.0
Learning iPad Programming is now my go-to reference when developing apps for the iPad. This book is an absolute treasure trove of useful information and tips for developing on the iPad. While its easy to think of the iPad as just a bigger iPhone, there are specific topics that need to be treated differently on the iPad, such as making best use of the larger display. Learning iPad Programming provides an incredible amount of depth on all areas of iPad programming and takes you from design to fully functioning applicationwhich for me is a killer feature of the book. This should be in everyones reference library.
Mike Daley
Author, Learning iOS Game Programming
Cofounder, 71Squared.com
has you covered: Rather than just providing canned example code, Kirby and Tom give you real code that incrementally builds and improves a real app. And if youve been working with iOS for a while, but would benefit from a walk-through of the plethora of new features that have come our way with iOS 5 and Xcode 4, dive into the chapters on Storyboards, iCloud, and Core Image. Best of all, the book is well-written and conversational, making it a joy to read. This book is stellar.
Alexis Goldstein
Coauthor, HTML5 & CSS3 for the Real World
Learning iPad Programming is one of the most comprehensive resources on the planet for those developing for Apples iPad platform. In addition to coverage of the language, frameworks, and tools, it dives into features new in iOS 5, like Automatic Reference Counting, Storyboarding, and connecting your applications with iCloud. But where this book really shines is in the tutorials and the application you will build as you read through this book. Rather than being a toy that employs only off-the-shelf iOS user interface components from Interface Builder, the PhotoWheel app demonstrates custom view programming and view controller containment, nonstandard gesture/user input handling, and provides insight into how a complex iOS project comprised of multiple subsystems is assembled into a shipping application. In other words, Learning iPad Programming shows how to deal with the challenges youll face in real iPad development.
Erik Price
Senior Software Engineer, Brightcove
A thoroughly crafted guide for learning and writing iOS applications, from the humble beginnings in Xcode and Interface Builder to creating a full-featured iPad application. There are many books that try to cover the gamut of knowledge required to take a reader from zero to app; Kirby and Tom have actually done it in this book. It is a fun and comprehensive guide to the world of developing apps for Apples magical device.
Rod Strougo
Founder, Prop Group