Book Image

iOS Development with Xamarin Cookbook

By : Dimitrios Tavlikos (USD)
Book Image

iOS Development with Xamarin Cookbook

By: Dimitrios Tavlikos (USD)

Overview of this book

Table of Contents (22 chapters)
iOS Development with Xamarin Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

iCloud key/value storage


In this recipe, we will learn how to save and retrieve small amounts of data that are suitable for storing app settings or anything that would be useful to be shared among different devices.

Note

Apps can only store up to a total of 1 MB of data with key/value store, in up to 1024 keys. So it cannot be used to back up files or similar functionality.

Getting ready

We will need two devices under the same iCloud account to actually see iCloud storage in action. On one device we will save some data, and on the second device we will load the data. If only one device is available, it is not an issue as it will work flawlessly because the data will just be loaded from local storage, instead of iCloud.

How to do it...

The following are the steps to complete the recipe:

  1. Create a new iPhone Single View Application in Xamarin Studio and enable it for iCloud, as shown in the previous recipe. Name the project KeyValueApp.

  2. Add two buttons and one label on the view controller.

  3. Add the following...