Created
May 9, 2012 00:12
-
-
Save escoz/2640625 to your computer and use it in GitHub Desktop.
quickdialog+couchdb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// loads json files directly from couchdb, and syncs to data also in couch. | |
#import "QRootElement+CouchDocument.h" | |
#import "App.h" | |
#import <CouchCocoa/CouchCocoa.h> | |
@implementation QRootElement (CouchDocument) | |
- (QRootElement *)initWithCouchDocument:(NSString *)name { | |
CouchDocument *document = [[[App shared] database] documentWithID:name] ; | |
self = [[QRootBuilder new] buildSectionsWithObject:document.userProperties]; | |
return self; | |
} | |
- (QRootElement *)initWithCouchDocument:(NSString *)name andDataDocument:(NSString *)dataname{ | |
self = [self initWithCouchDocument:name]; | |
if (dataname!=nil){ | |
CouchDocument *datadoc = [[[App shared] database] documentWithID:dataname] ; | |
[self bindToObject:datadoc.userProperties]; | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment