GDStore 0.5.5

GDStore 0.5.5

TestsTested
LangLanguage Obj-CObjective C
License Apache 2
ReleasedLast Release Dec 2014

Maintained by Larry Tin.



GDStore 0.5.5

  • By
  • Larry Tin

iOS and Mac OS X Client for realtime-store

Visit Google groups for discussions and announcements.

Adding GDStore to your project

Usage

id<GDSStore> store = [[GDSStoreImpl alloc]
    initWithServerUri:@"ws://localhost:1986/channel/websocket" withOptions:nil];

void (^onLoaded)(id<GDSDocument>) = ^(id<GDSDocument> document) {
  id<GDSModel> model = [document getModel];
  id<GDSCollaborativeMap> root = [model getRoot];
  id<GDSCollaborativeString> name = [root get:@"name"];
  NSLog(@"Name: %@", [name getText]);
};

void (^opt_initializer)(id<GDSModel>) = ^(id<GDSModel> model) {
  id<GDSCollaborativeMap> root = [model getRoot];
  id<GDSCollaborativeString> name = [model createString:@"Larry Tin"];
  [root set:@"name" value:name];
};

[store load:@"docType/docId" onLoaded:onLoaded opt_initializer:opt_initializer opt_error:nil];