Skip to content

Commit

Permalink
pass the couchbaseURL to the save button
Browse files Browse the repository at this point in the history
  • Loading branch information
jchris committed Mar 19, 2011
1 parent 55ee13f commit 2041c44
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Demo/Classes/NewItemViewController.h
Expand Up @@ -28,4 +28,5 @@

@property(nonatomic,retain)IBOutlet UITextView *textView;
@property(assign) id delegate;

@end
2 changes: 1 addition & 1 deletion Demo/Classes/NewItemViewController.m
Expand Up @@ -80,7 +80,7 @@ -(void)done
NSString *guid = (NSString*)CFUUIDCreateString(nil, uuid);
CFRelease(uuid);
NSString *docId = [NSString stringWithFormat:@"%f-%@", CFAbsoluteTimeGetCurrent(), guid];
DatabaseManager *sharedManager = [DatabaseManager sharedManager];
DatabaseManager *sharedManager = [DatabaseManager sharedManager:[delegate getCouchbaseURL]];
CURLOperation *op = [sharedManager.database operationToCreateDocument:inDocument
identifier:docId
successHandler:inSuccessHandler
Expand Down
1 change: 1 addition & 0 deletions Demo/Classes/RootViewController.h
Expand Up @@ -32,5 +32,6 @@

-(void)loadItemsIntoView;
-(void)couchbaseDidStart:(NSURL *)serverURL;
-(NSURL *)getCouchbaseURL;

@end
3 changes: 3 additions & 0 deletions Demo/Classes/RootViewController.m
Expand Up @@ -33,6 +33,9 @@ @implementation RootViewController
#pragma mark -
#pragma mark View lifecycle

-(NSURL *)getCouchbaseURL {
return self.couchbaseURL;
}

-(void)couchbaseDidStart:(NSURL *)serverURL {
self.couchbaseURL = serverURL;
Expand Down

0 comments on commit 2041c44

Please sign in to comment.