CONTENTS
Professional iOS Database Application Programming, Second Edition
Published by
John Wiley & Sons, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright 2013 by John Wiley & Sons, Inc., Indianapolis, Indiana
Published simultaneously in Canada
ISBN: 978-1-118-39184-6
ISBN: 978-1-118-39185-3 (ebk)
ISBN: 978-1-118-41757-7 (ebk)
ISBN: 978-1-118-72836-9 (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 publishes in a variety of print and electronic formats and by print-on-demand. Some material included with standard print versions of this book may not be included in e-books or in print-on-demand. If this book refers to media such as a CD or DVD that is not included in the version you purchased, you may download this material at http://booksupport.wiley.com . For more information about Wiley products, visit www.wiley.com .
Library of Congress Control Number: 2013933611
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.
For CherylWithout you, this would have never been possible.
CREDITS
ACQUISITIONS EDITOR
Mary James
PROJECT EDITOR
Brian MacDonald
TECHNICAL EDITOR
Michael Gilbert
PRODUCTION EDITOR
Christine Mugnolo
COPY EDITOR
Karen A. Gill
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
Sarah Kaikini, Word One New York
INDEXER
Robert Swanson
COVER DESIGNER
Elizabeth Brooks
COVER IMAGE
naphtalina / iStockphoto
ABOUT THE AUTHOR
PATRICK ALESSI has been fascinated with writing computer programs since he first saw his name flash across a terminal in 1980. Since then, he has written software using every language and hardware platform that he could get his hands on, including a brief and painful foray into Fortran on a VAX system during his engineering education. Patrick holds a BS degree in Civil Engineering from Rutgers University and an MS in Computer Science from Stevens Institute of Technology.
Professionally, Patrick has focused on data-centric applications for clients ranging from small business databases to large-scale systems for the United States Air Force. Currently, he is focused on the promise of mobility and developing connected applications for mobile devices such as the iPhone and iPad.
When he can back away from the computer, Patrick enjoys gaming (especially Starcraft ), photography, traveling, and doing just about anything with his family. You can follow him on Twitter at pwalessi and read his blog at iphonedevsphere.blogspot.com .
ABOUT THE TECHNICAL EDITOR
MICHAEL GILBERT is a long-time systems programmer for various engineering firms. He got his start developing games for the Atari ST, and he was a frequent contributing editor for STart magazine. Over the years, he has continued to develop gaming software on PC and Mac for clients worldwide. Hes also an expert Flash ActionScript programmer and has produced a popular Internet gaming environment called HigherGames. He now enjoys developing games for the iPhone and iPad, and currently has several games in the AppStore, with more on the way. In his spare time, he enjoys trying to defeat his wife Janeen in a friendly game of Scrabble.
ACKNOWLEDGMENTS
I WOULD LIKE TO TAKE THIS OPPORTUNITY TO THANK everyone who made this book possible. Mary James, my acquisitions editor, shepherded this second edition through the acquisitions process. My project editor, Brian MacDonald, was there to answer every question that I had about writing and the publishing process. Mike Gilbert, my technical editor, gave up valuable app development time to review my work. I would also like to thank all the other editorial and production staff that put many hours into this project to help get it to print.
I cannot thank my wife, Cheryl, and my stepdaughter, Morgan, enough for putting up with my fits, general crankiness, and lack of time for fun family activities as I worked my way through writing this book. Your patience with me is astounding. I want to thank my Mom for introducing me to computers at a very young age and teaching me the basics. Finally, I want to thank my Dad for pushing me to work hard and for showing me how to be a father.
INTRODUCTION
WITH THE INTRODUCTION OF THE IPHONE, Apple revolutionized the mobile computing market. The iPhone transformed the mobile phone from a device that you could use to make calls, check e-mail, and look up movie times into a computer that could run almost any type of application. Since the iPhones release in 2007, developers have written over 700,000 applications that run on iOS devices. These apps encompass many categories, including games, utilities, social networking, reference, navigation, and business, among many others.