Here is MBCloudNumber. It's a class to use for writing and reading number values (integer for now, but you could add floats easily.)
// Initialize this in your -applicationDidFinishLaunching
// so iCloud changes are detected and initial values are copied over.
[[MBCloudNumber globalSettings] synchronize];
//To set a value, just pass it in, saying whether it should only increase/decrease
[[MBCloudNumber globalSettings] setNumber:score forKey:@"HighScore" increases:YES];
//And then it's easy to read values out too.
NSInteger highScore = [[MBCloudNumber globalSettings] numberForKey:@"HighScore"];
You'll still need to setup the iCloud Key-Value Store entitlements in your project.
You'll still need to setup the iCloud Key-Value Store entitlements in your project.
No comments:
Post a Comment