Apress - Pro Core Data for iOS.pdf

(7871 KB) Pobierz
Store and retrieve your Apps data
accurately and efficiently
Pro
Core Data for iOS
Data Access and Persistence Engine for iPhone, iPad, and iPod touch
Michael Privat | Robert Warner
780204769.045.png 780204769.055.png 780204769.065.png 780204769.076.png
 
 
 
 
 
 
 
780204769.017.png 780204769.018.png 780204769.019.png 780204769.020.png 780204769.021.png 780204769.022.png 780204769.023.png 780204769.024.png 780204769.025.png 780204769.026.png 780204769.027.png 780204769.028.png
 
 
 
 
 
 
 
780204769.029.png 780204769.030.png 780204769.031.png 780204769.032.png 780204769.033.png 780204769.034.png 780204769.035.png 780204769.036.png 780204769.037.png 780204769.038.png 780204769.039.png 780204769.040.png 780204769.041.png 780204769.042.png 780204769.043.png
 
 
780204769.044.png 780204769.046.png 780204769.047.png 780204769.048.png 780204769.049.png 780204769.050.png 780204769.051.png 780204769.052.png 780204769.053.png 780204769.054.png 780204769.056.png 780204769.057.png 780204769.058.png 780204769.059.png 780204769.060.png 780204769.061.png 780204769.062.png 780204769.063.png 780204769.064.png 780204769.066.png 780204769.067.png 780204769.068.png 780204769.069.png 780204769.070.png 780204769.071.png 780204769.072.png 780204769.073.png 780204769.074.png 780204769.075.png 780204769.077.png 780204769.078.png 780204769.079.png 780204769.080.png 780204769.081.png 780204769.082.png 780204769.083.png 780204769.084.png 780204769.085.png 780204769.086.png 780204769.001.png 780204769.002.png
 
Pro Core Data for iOS
Data Access and Persistence Engine for iPhone, iPad,
and iPod touch
■ ■ ■
Michael Privat
and Rob Warner
i
780204769.003.png 780204769.004.png 780204769.005.png 780204769.006.png 780204769.007.png 780204769.008.png 780204769.009.png 780204769.010.png
CONTENTS
Pro Core Data for iOS: Data Access and Persistence Engine for iPhone, iPad, and iPod touch
Copyright © 2011 by Michael Privat and Rob Warner
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-4302-3355-8
ISBN-13 (electronic): 978-1-4302-3356-5
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol
with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only
in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of
the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are
not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject
to proprietary rights.
President and Publisher: Paul Manning
Lead Editor: Steve Anglin
Development Editor: Douglas Pundick
Technical Reviewer: Robert Hamilton
Editorial Board: Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell, Jonathan Gennick,
Jonathan Hassell, Michelle Lowman, Matthew Moodie, Jeffrey Pepper, Frank Pohlmann,
Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft, Matt Wade, Tom Welsh
Coordinating Editor: Jennifer L. Blackwell
Copy Editor: Kim Wimpsett
Indexer: BIM Indexing & Proofreading Services
Compositor: Richard Ables
Artist: April Milne
Cover Designer: Anna Ishchenko
Distributed to the book trade worldwide by Springer Science+Business Media, LLC.,
orde rs-ny @spri nger-sbm.com , or visit www.sp ringeronline.com .
For information on translations, please e-mail rights@apress.com , or visit www.apress.com .
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our
Special Bulk Sales–eBook Licensing web page at www.apress.com/info/bulksales .
The source code for this book is availale to readers at www.apress.com .
780204769.011.png
 
CONTENTS
To my loving wife, Kelly, and our children, Matthieu and Chloé.
—Michael Privat
To my beautiful wife Sherry and our wonderful children: Tyson, Jacob, Mallory, Camie, and
Leila.
—Rob Warner
 
780204769.012.png
CONTENTS
Contents at a Glance
About the Authors............................................................................................................................... xii
About the Technical Reviewer........................................................................................................... xiii
Acknowledgments............................................................................................................................. xiv
Introduction....................................................................................................................................... xvi
Chapter 1: Getting Started....................................................................................................................1
Chapter 2: Understanding Core Data..................................................................................................27
Chapter 3: Storing Data: SQLite and Other Options............................................................................57
Chapter 4: Creating a Data Model.....................................................................................................107
Chapter 5: Working with Data Objects.............................................................................................129
Chapter 6: Refining Result Sets........................................................................................................181
Chapter 7: Tuning Performance and Memory Usage........................................................................203
Chapter 8: Versioning and Migrating Data.......................................................................................251
Chapter 9: Using Core Data in Advanced Applications.....................................................................283
Index:................................................................................................................................................359
780204769.013.png 780204769.014.png 780204769.015.png 780204769.016.png
Zgłoś jeśli naruszono regulamin