CloudKit Tutorial: Getting Started

In this CloudKit tutorial, you’ll learn how to add and query data in iCloud from your app, as well as how to manage that data using the CloudKit dashboard. By Andy Pereira.

Leave a rating/review
Download materials
Save for later
Share
You are currently viewing page 4 of 4 of this article. Click here to view the first page.

Troubleshooting Queries

If the data isn’t appearing properly – or isn’t appearing at all – inspect the sample data using the CloudKit dashboard. Make sure all of the records are present, that you’ve added them to the default zone and that they have the correct values.

If you need to re-enter the data, you can delete records by clicking the trash icon.

Debugging CloudKit errors can be tricky. CloudKit error messages often don’t contain a tremendous amount of information.

To determine the cause of the error, you can look at the error code in conjunction with the particular database operation you’re attempting. Using the numerical error code, look up the matching CKErrorCode enum. The name and description in the documentation will help narrow down the cause of the issue.

Note: For a list of error codes that CloudKit can return, read the CKError Reference.

Where to Go From Here?

You can download the final version of the project using the Download Materials button at the top or bottom of this CloudKit tutorial.

You can enhance the app in several ways:

  • Allow the user to add their own pictures and notes.
  • Let the user create new Establishment records that only they can see.
  • Provide caching and synchronization so the app remains responsive offline and keeps the content up to date when it reconnects to a network.

For more information, watch Brian Moakley’s Video Tutorial Series on CloudKit.

You can also check out Apple’s documentation on CloudKit.

With CloudKit, you can take your apps to the next level and beyond with this great Apple-provided back-end API. We can’t wait to see what you make.

If you have any questions or comments about this tutorial, please join the forum discussion below!