O'Reilly logo

Mac Application Development by Example Beginner's Guide by Robert Wiebe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – accessing iCloud for key-value storage

Because we are going to store our numbers in iCloud using a key-value pairing, we need to use a key to access the value. Since iCloud will automatically associated the key with our App's bundle identifier, it can be any arbitrary value. We will choose to use @"numbers".

  1. Add the following define to BTSAppDelegate.h to create the key:
    // Define the key that we will use
    // to access our numbers in the 
    // iCloud key / value data store
    #define kBTSNCNumbersKey @"numbers"
  2. Add the code to BTSAppDelegate.m that creates the mutable array we will use to store our numbers. This code will first try to load the numbers from iCloud and if they are not found in iCloud then it will create a new empty NSMutableArray ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required