HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
“A great read for iOS developers who want to learn if iCloud is right for their app and dive right in with lots of practical code examples.”
—Jon Bell, UXLaunchpad.com
Get Hands-On Mastery of iCloud Data Management for iOS 7 and OS X Mavericks
As apps rapidly move into business and the cloud, iOS and OS X developers need new data management techniques. In Learning iCloud Data Management, renowned Apple database expert Jesse Feiler shows you how to use Apple’s latest APIs and technologies to structure and synchronize all forms of data. Feiler helps you understand the issues, implement efficient solutions, and deliver highly usable apps that seamlessly synchronize during the “Round Trip” between iOS and OS X and back again.
This guide walks you through integrating several key Apple data management technologies, including the Address Book and Calendar APIs. Feiler shows you how to structure data so it’s easy to build great Cocoa and Cocoa Touch user interfaces and to quickly incorporate reliable iCloud syncing. Step by step, you’ll discover how to blend Apple’s standard application data structures with your own user data to create a feature-rich and fully syncable environment.
Coverage includes
Learning iCloud Data Management: Setting Up iCloud for Development
Download the sample pages (includes Chapter 2 and Index)
Preface xvii
Acknowledgments xxiii
About the Author xxv
Introduction 1
Part I: Introducing iCloud 3
Chapter 1: Exploring iCloud and Its User Experience 5
Looking at Cloud Computing 5
Understanding the iCloud Paradigm 7
Making the Round Trip 14
Chapter Summary 14
Exercises 15
Chapter 2: Setting Up iCloud for Development 17
Managing App Security on iOS and OS X 18
Looking Inside the iCloud Basics 23
Using iCloud in Your App 30
Chapter Summary 31
Exercises 32
Part II: Using the APIs 33
Chapter 3: Introducing the APIs and the First Apps 35
Getting Started as an Apple Developer 35
Looking at the APIs 37
Introducing the Built-In Data Apps 38
Wiring Up the Interfaces 50
Chapter Summary 55
Exercises 55
Chapter 4: Working with the AddressBook API for Contacts 57
Considering the AddressBook API on iOS and OS X 57
Sending Mail from the iOS App 58
Sending Mail from the OS X App 65
Using Property Lists for Storing and Syncing 65
Chapter Summary 66
Exercises 67
Chapter 5: Managing Calendars and Reminders with the Event Kit API 69
Exploring the Event Class Hierarchy 70
Setting OS X Permissions 71
Working with the Calendar Database 72
Adding a Reminder to the App on iOS 80
Adding an Event to the App on OS X 83
Chapter Summary 85
Exercises 85
Chapter 6: Protecting the Privacy of User Data 87
The Need for Privacy 87
Looking at Apple’s Rules and Guidelines 88
Best Practices in App Privacy 88
Chapter Summary 93
Exercises 93
Part III: Using the Technologies 95
Chapter 7: Introducing Blocks, Threads, and Notifications 97
Catching Up with Blocks and Threads 98
Getting Up to Speed with Notifications 100
Receiving Notification of iCloud Availability Changes 102
Introducing the Second Project 103
Getting Ready to Move On 103
Chapter Summary 104
Exercises 104
Chapter 8: Using Key-Value Coding (KVC) 105
Setting Up a Controlled Testing Environment 106
Implementing KVC 106
Testing iCloud on iOS Simulator 107
Preparing Your Project for Testing 108
Sharing the Key-Value Store for the Round Trip 110
Setting Up and Using NSUbiquitousKeyValueStore 111
Chapter Summary 120
Exercises 120
Chapter 9: Using Preferences, Settings, and Keychains with iCloud 121
Using Property Lists 122
Working with User Defaults 128
Registering Defaults 130
Chapter Summary 131
Exercises 131
Chapter 10: Managing Persistent Storage with Core Data 133
Understanding the Goals of Core Data 134
Structuring Data 135
Understanding How Core Data Works with iCloud 139
Introducing the Core Data Project 139
Using the Xcode Data Modeling Tool 142
Examining the Core Data Stack 154
Chapter Summary 155
Exercises 155
Chapter 11: Using Xcode Workspaces for Shared Development 157
Building on the Digital Hub 158
Reviewing Xcode File Management