Skip to content

RCCBox/RCC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

##RCCUbiquitousObjectsController

RCCUbiquitousObjectsController is a controller class with an additional persistent NSObject subclass and some categories for NSArray and NSMutableArray that makes storing and syncing objects in the iCloud key value store easy.

###Overview

  • Store and sync objects in the cloud in three lines of code.
  • Falls back to local storage if the cloud is not available
  • RCCUbiquitousObjectsController acts as a one stop location for everything cloud related
  • Automatic duplication and object update handling
  • RCC uses NSObject-AutomagicCoding for property conversion see here what can be stored.

Getting started

In order to store a bunch of objects and keep them in sync over several iCloud enabled devices all you have to do is this:

// MySampleViewController

// Init RCCUbiquitousObject controller
self.ubiquitousObjectsController = [[RCCUbiquitousObjectsController alloc] init];

// Init a synced object subclass
MyUbiquitousObject *rccUObj = [MyUbiquitousObject alloc] init];

// Store your properties in the subclass
rccUObj.name    = @"Humpty Dumpty";
rccUObj.species = @"Anthropomorphic egg"

// Store and sync the object
[self.ubiquitousObjectsController storeRCCUbiquitousObject:rccUObj];

// Load all synced persistent objects
NSArray *mySyncedObjects = self.ubiquitousObjectsController.ubiquitousObjects;

// Update UI on store changes
[self.ubiquitousObjectsController addObserverForKeyPath:@"ubiquitousObjects" owner:self block:updateUI];

// Remove a synced object locally and from the cloud
[self.ubiquitousObjectsController removeRCCUbiquitousObject:rccUObj];

See the included sample app for a basic example. The app automatically stores and updates a set of user credentials using the iCloud key-value storage.

Documentation

Documentation is available here or can be generated by building the Documentation target. The generated docs will be stored in the XCode docs path and can be read in the organizer.

Known issues

Lots. This is experimental and definitely no production code!

Two different clock settings on multiple devices can lead to synchronization errors (example: setting the clock on one device to a distant future makes the syncing algorithm always prefer this data)

Installing the app on an additional device with other installations already running wipes the store on these devices under some circumstances.

After installing the app on an additional device with other installations already running the iCloud store sometimes only gets synced to this device after adding a new entry.

Acknowledgements

RCC makes heave use these open source projects::

About

Dead easy iCloud Key-Value store access

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published