CONTENTS
Beginning iOS 5 Application Development
Published by
John Wiley & Sons, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright 2012 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-118-14425-1
ISBN: 978-1-118-22571-4 (ebk)
ISBN: 978-1-118-23584-3 (ebk)
ISBN: 978-1-118-26369-3 (ebk)
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections 107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be addressed to the Permissions Department, John Wiley & Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at http://www.wiley.com/go/permissions .
Limit of Liability/Disclaimer of Warranty: The publisher and the author make no representations or warranties with respect to the accuracy or completeness of the contents of this work and specifically disclaim all warranties, including without limitation warranties of fitness for a particular purpose. No warranty may be created or extended by sales or promotional materials. The advice and strategies contained herein may not be suitable for every situation. This work is sold with the understanding that the publisher is not engaged in rendering legal, accounting, or other professional services. If professional assistance is required, the services of a competent professional person should be sought. Neither the publisher nor the author shall be liable for damages arising herefrom. The fact that an organization or Web site is referred to in this work as a citation and/or a potential source of further information does not mean that the author or the publisher endorses the information the organization or Web site may provide or recommendations it may make. Further, readers should be aware that Internet Web sites listed in this work may have changed or disappeared between when this work was written and when it is read.
For general information on our other products and services please contact our Customer Care Department within the United States at (877) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats and by print-on-demand. Not all content that is available in standard print versions of this book may appear or be packaged in all book formats. If you have purchased a version of this book that did not include media that is referenced by or accompanies a standard print version, you may request this media by visiting http://booksupport.wiley.com . For more information about Wiley products, visit us at www.wiley.com .
Library of Congress Control Number: 2011944672
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Wrox Programmer to Programmer, and related trade dress are trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other countries, and may not be used without written permission. All other trademarks are the property of their respective owners. John Wiley & Sons, Inc., is not associated with any product or vendor mentioned in this book.
Dedicated to Steve Jobs, whose vision changed the way we use computers and inspires many to follow his footsteps. Thank you for the inspiration!
ABOUT THE AUTHOR
WEI-MENG LEE is a technologist and founder of Developer Learning Solutions (.
ABOUT THE TECHNICAL EDITOR
TRENT SHUMAY is the founder and Chief Architect at Finger Food Studios, Inc., in the Vancouver, BC, area. After graduating from the UBC Computer Science program, Trent spent 13 years in the gaming and interactive entertainment space, where handheld gaming devices ignited his passion for mobile development. Today, Finger Food Studios focuses on developing media-rich, interactive mobile and web applications. You can reach Trent directly at .
CREDITS
EXECUTIVE EDITOR
Robert Elliott
SENIOR PROJECT EDITOR
Ami Frank Sullivan
TECHNICAL EDITOR
Trenton Shumay
PRODUCTION EDITOR
Kathleen Wisor
COPY EDITOR
Luann Rouff
EDITORIAL MANAGER
Mary Beth Wakefield
FREELANCER EDITORIAL MANAGER
Rosemarie Graham
ASSOCIATE DIRECTOR OF MARKETING
David Mayhew
MARKETING MANAGER
Ashley Zurcher
BUSINESS MANAGER
Amy Knies
PRODUCTION MANAGER
Tim Tate
VICE PRESIDENT AND EXECUTIVE GROUP PUBLISHER
Richard Swadley
VICE PRESIDENT AND EXECUTIVE PUBLISHER
Neil Edde
ASSOCIATE PUBLISHER
Jim Minatel
PROJECT COORDINATOR, COVER
Katie Crocker
PROOFREADER
Nancy Carrasco
INDEXER
Robert Swanson
COVER DESIGNER
Ryan Sneed
COVER IMAGE
-M-I-S-H-A- /iStockPhoto
ACKNOWLEDGMENTS
OVER THE PAST YEAR OR SO , the development landscape of Apples iOS has changed greatly. The successful iOS is now in its fifth iteration, and the Xcode IDE has transitioned to a much easier-to-use version 4, with a tight integration of Interface Builder. I have received a lot of feedback from readers of the previous edition of this book, many of whom appreciate the hands-on approach that it takes. I also have received feedback from readers who are stumped by the changes that have occurred between Xcode versions 3 and 4; but such confusion epitomizes the rapid pace of change that all developers experience.
This new edition of the book was revised to cover both new technologies and the various feedback I have received. I had a thorough relook at the exercises readers were having issues with, to ensure that they can be easily followed and achieve the effect I intended. I also took this opportunity to revise all the examples using Xcode 4, which is the IDE included with iOS 5. Of course, this book covers new iOS 5 features notably, the new iCloud feature that ships with iOS 5. I have also added some topics that would interest most iOS developers, such as how to import and export documents from within your application, programming the various sensors in iOS, and using JSON web services.
Writing a book is always exciting, but along with the excitement are long hours of hard work, straining to get things done accurately and on time. I would like to take this opportunity to thank a number of people who helped to make this book possible.
First, I want to thank my Executive Editor Robert Elliott, who started off as a stranger, but is now my good friend. Robert is not the usual AE, disappearing after the contract is signed. He has been involved throughout the entire writing process and is always ready to help. I cant say enough good things about Robert, so I will just say thank you, Robert!
Next, a huge thanks to Ami Sullivan, my project editor, who is always a pleasure to work with. Ami is the force behind the scenes, who makes the book appear on time on shelves in the bookstores! Thanks, Ami!