Learning Core Data for iOS: A Hands-On ... | WHSmith Books
Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications

Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications

By: Tim Roadley (author)Paperback

Up to 2 WeeksUsually despatched within 2 weeks


Get Started Fast with iOS 7 Core Data App DevelopmentCovers iOS 7 and Xcode 5This is the first Core Data book to fully reflect Apple's latest platform innovations, including its dramatic recent improvements to iCloud support. Hands-on from start to finish, it teaches you step-by-step as you create a modern data-driven iOS app using Storyboards, ARC, iOS 7, and Xcode 5.Tim Roadley introduces new patterns and best practices designed to overcome the frustrations of Core Data development. One step at a time, you'll build and extend your skills--even mastering advanced techniques such as complex model migration, deep copy, background processing, and integration with Dropbox, StackMob, and iCloud. Downloadable versions of this book's main project are provided with each chapter, so you can see exactly what your app project should look like--and get cookbook-style code for your own projects. Chapter exercises help you explore even further, whether you're a self-learner or a student in an iOS development course.If you're an experienced iOS developer, this guide brings together all the skills, tools, code, and patterns you need to add powerful data management capabilities to any app--quickly, easily, and painlessly.Coverage includes the following:Understanding Core DataAdding Core Data to an existing projectDesigning, upgrading, and migrating data models (automatically and manually with progress indication)Populating views with data, including table-views and picker-viewsPreloading a "default data" persistent store from XMLDeep-copying from one persistent store to anotherPerformance tuning with Instruments, using large photos as the exampleBackground processing, using thumbnail generation as the exampleEfficient searchSeamlessly backing up and restoring with DropboxStable integration with iCloud--with full support for multiple accounts, seeding, and de-duplicationWeb service integration with StackMob

About Author

Tim Roadley is a senior analytics software consultant at Emite Pty Ltd. He is primarily focused on delivering business intelligence dashboards, currently for one of Australia's major banks. Prior to Emite, Tim was Infrastructure Manager at Cuscal Pty Ltd, where he was heavily involved in designing and implementing a payments switch that drives 1,300+ ATMs throughout Australia. By night he is an avid iOS developer and tutorial writer, with several apps on the App Store, including Teamwork, iSoccer, and now Grocery Dude and Grocery Cloud. In his downtime, he enjoys spending time with his wonderful wife, Tracey, and two lovely children, Tyler and Taliah.


Preface xvChapter 1: Your First Core Data Application 1What Is Core Data? 1Persistent Store Coordinator 2Managed Object Model 4Managed Object Context 4When to Use Core Data 5Introducing Grocery Dude 5Adding Core Data to an Existing Application 6Introducing Core Data Helper 7Core Data Helper Implementation 9Files 9Paths 10Setup 11Saving 14Summary 16Exercises 16Chapter 2: Managed Object Model Basics 19What Is a Managed Object Model? 19Adding a Managed Object Model 20Entities 20Attributes 22Integer 16/32/64 23Float and Double 24Decimal 25String 25Boolean 25Date 25Binary Data 26Transformable 26Attribute Settings 28Subclassing NSManagedObject 29Scalar Properties for Primitive Data Types 31Snippet Demo Method 31Creating a Managed Object 32Backend SQL Visibility 33Fetching Managed Objects 36Fetch Request Sorting 38Fetch Request Filtering 39Fetch Request Templates 40Deleting Managed Objects 42Summary 43Exercises 43Chapter 3: Managed Object Model Migration 45Changing a Managed Object Model 45Adding a Model Version 47Lightweight Migration 48Default Migration 52Migration Manager 57Summary 69Exercises 69Chapter 4: Managed Object Model Expansion 71Relationships 71Delete Rules 77Validation Errors 81Entity Inheritance 86Summary 90Exercises 90Chapter 5: Table Views 91Table Views 101 91Core Data Table Views 93Introducing CoreDataTVC 93Fetching 95DATASOURCE: UITableView 96DELEGATE: NSFetchedResultsController 98AppDelegate's CoreDataHelper Instance 104Introducing PrepareTVC 105Data 106View 108Interaction 114Introducing ShopTVC 117Data 117View 118Interaction 121Summary 122Exercises 122Chapter 6: Views 125Overview 125The Target View Hierarchy 126Introducing ItemVC 127Keeping Reference to a Selected Item 128Passing a Selected Item to ItemVC 128Configuring the Scroll View and Text Fields 129ItemVC Implementation 134Interaction 134DELEGATE: UITextField 136View 137Data 139Units, Home Locations, and Shop Locations 143Adding and Editing Units 145Implementing UnitsTVC 147Implementing UnitVC 149Segue from UnitsTVC to UnitVC 153Adding and Editing Home or Shop Locations 154Configuring the Home Location Views 154Configuring the Shop Location Views 156Summary 158Exercises 158Chapter 7: Picker Views 159Overview 159Introducing CoreDataPickerTF 160DELEGATE+DATASOURCE: UIPickerView 162Interaction 164Data 165View 165Introducing UnitPickerTF 168Creating the Unit Picker 170Connecting the Unit Picker 171Configuring ItemVC for the Unit Picker 171Introducing LocationAtHomePickerTF 176Introducing LocationAtShopPickerTF 178Creating the Location Pickers 179Connecting the Location Pickers 180Configuring ItemVC for the Location Pickers 181Picker-Avoiding Text Field 186Summary 188Exercises 188Chapter 8: Preloading Data 189Default Data 189Is an Import Required? 190Importing from XML 193Creating an Import Context 196Preventing Duplicate Default Data 197Triggering a Default Data Import 198Introducing CoreDataImporter 200Selecting Unique Attributes 205Mapping XML Data to Entity Attributes 206Importing from a Persistent Store 209Using the Default Data Store as the Initial Store 210Summary 213Exercises 214Chapter 9: Deep Copy 215Overview 215Configuring a Source Stack 218Configuring the Source Store 219Enhancing CoreDataImporter 221Object Info 221Array For Entity 222Copy Unique Object 223Establish To-One Relationship 224Establish To-Many Relationship 226Establish Ordered To-Many Relationship 227Copy Relationships 228Deep Copy Entities 230Triggering a Deep Copy 232Summary 236Exercises 236Chapter 10: Performance 239Identifying Performance Issues 239Implementing the Camera 240Generating Test Data 245Measuring Performance with SQLDebug 250Measuring Performance with Instruments 251Improving Performance 254Clean Up 261Summary 262Exercises 262Chapter 11: Background Processing 263Background Save 263Background Processing 268Introducing Faulter 269Introducing Thumbnailer 273Summary 279Exercises 279Chapter 12: Search 281Updating CoreDataTVC 282Updating PrepareTVC 289Summary 294Exercises 294Chapter 13: Back Up and Restore with Dropbox 297Dropbox Integration 298Supporting Frameworks 299Linking to Dropbox 300Introducing DropboxHelper 302Introducing DropboxTVC 304Preparing CoreDataHelper 307Building DropboxHelper 308Local File Management 308Dropbox File Management 310Backup & Restore 312Building DropboxTVC 316Creating Backups 319Displaying Backups 322Restore 324Summary 328Exercises 328Chapter 14: iCloud 331Overview 331Enabling iCloud 333Updating CoreDataHelper for iCloud 334The iCloud Store 335iCloud Notifications 337The Debug Navigator 341Disabling iCloud 342Summary 348Exercises 348Chapter 15: Taming iCloud 351De-Duplication 351Seeding 360Developing with a Clean Slate 367Configurations 369Finishing Touches 370Summary 371Exercises 372Chapter 16: Web Service Integration 379Introducing StackMob 379The StackMob SDK 381Creating a StackMob Application 382Managed Object Model Preparation 383Configuring a StackMob Client 385Saving 387Underlying Changes 389Automatic Schema Generation 390Schema Permissions 393Authentication 394Securing the User Class 396Introducing LoginVC 397Maintaining Responsiveness 406Summary 408Exercises 409Appendix A: Preparing Grocery Dude for Chapter 1 411New Xcode Project 411Storyboard Design 412App Icons and Launch Images 415Appendix B: Preparing Grocery Cloud for Chapter 16 417Renaming Grocery Dude 417Repointing File Paths 418Renaming Groups and Tests 419Renaming the Scheme 420Updating the Artwork 421Disabling Camera and Image Support 421Workaround: Section Name Key Path Issue 422Summary 423Index 425

Product Details

  • ISBN13: 9780321905765
  • Format: Paperback
  • Number Of Pages: 480
  • ID: 9780321905765
  • weight: 754
  • ISBN10: 0321905768

Delivery Information

  • Saver Delivery: Yes
  • 1st Class Delivery: Yes
  • Courier Delivery: Yes
  • Store Delivery: Yes

Prices are for internet purchases only. Prices and availability in WHSmith Stores may vary significantly