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"
.
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"
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 emptyNSMutableArray
object as shown in the following code snippet:// This method is invoked automatically // when our App finishes launching - (void)applicationDidFinishLaunching: (NSNotification *)aNotification { // Insert code here to initialize...