Database Reference
In-Depth Information
worry—there are plenty of things to add in the user interface and there are sync
operations to test, which will keep you busy for the rest of this chapter!
Core Data is doing a number of things under the hood to enable this capability for
you. One of the items Core Data sets up for you is a fallback store. In some
instances, circumstances will severely compromise access to iCloud (the “driving
through a tunnel” scenario). For Core Data to continue to function for your app
during these times, the fallback store is there to hold onto data while iCloud is
offline. You don't have to worry about the fallback store at all; Core Data manages
it for you entirely.
However, one of the caveats to letting Core Data manage the iCloud mechanism for
you is that you can only have a single iCloud persistent store file per account. When
it comes to testing your app, it's helpful to have multiple test accounts.
Testing iCloud
Testing applications with iCloud means you have to have the app installed on at
least two devices. In the olden days of iOS 5 and 6, iCloud syncing wasn't available
on the iOS Simulator, which meant that to test iCloud, developers had to own
multiple devices and run their app on each device.
Luckily, Apple has heard our calls, and you can now enable iCloud in your iOS
Simulator! This means you only need one device and the Simulator to test iCloud
integration.
Fire up CloudNotes right now on the Simulator. Not much has changed. The app
launches, but nothing is happening otherwise, especially in regard to data syncing.
There are a couple of steps necessary to set up the Simulator for iCloud testing.
If you want to use your regular iCloud account, you can skip ahead to the section
called, “Setting up iCloud on the Simulator,” below. I suggest continuing with
creating and using a test account so as to keep test data separate from your
personal data. You'll need to enable iCloud drive on the accounts you use for this
tutorial, which you might not want for your personal iCloud account.
Creating a test account
Point Safari or your web browser of choice to https://itunesconnect.apple.com and
log in with your Apple developer ID.
From the main menu of the iTunes Connect portal, select Users and Roles . You
want a test user so select Sandbox Testers at the top of the screen, then click the
plus ( +) button to add a new user. From here, you can fill out the form to create a
new test user on the iTunes store.
 
Search WWH ::




Custom Search