Permalink
Browse files

Use updated Couchbase framework names

CouchbaseEmbeddedServer --> CouchbaseMobile, etc.
Also the delegate API changed a bit.
  • Loading branch information...
1 parent 525d7dc commit 57a610d2a631674f9c1937d51b14b364a4adb1cb @snej snej committed Aug 24, 2011
View
10 CouchDemo.xcodeproj/project.pbxproj
@@ -193,9 +193,9 @@
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
- 27167F1813C4FA57001CC5B6 /* CouchDemo */ = {
+ 27167F1813C4FA57001CC5B6 /* GrocerySync */ = {
isa = PBXNativeTarget;
- buildConfigurationList = 27167F5E13C4FA57001CC5B6 /* Build configuration list for PBXNativeTarget "CouchDemo" */;
+ buildConfigurationList = 27167F5E13C4FA57001CC5B6 /* Build configuration list for PBXNativeTarget "GrocerySync" */;
buildPhases = (
27167F1913C4FA57001CC5B6 /* Resources */,
27167F2313C4FA57001CC5B6 /* Copy CouchDB */,
@@ -206,7 +206,7 @@
);
dependencies = (
);
- name = CouchDemo;
+ name = GrocerySync;
productName = Demo;
productReference = 27167F6113C4FA57001CC5B6 /* GrocerySync.app */;
productType = "com.apple.product-type.application";
@@ -234,7 +234,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
- 27167F1813C4FA57001CC5B6 /* CouchDemo */,
+ 27167F1813C4FA57001CC5B6 /* GrocerySync */,
);
};
/* End PBXProject section */
@@ -371,7 +371,7 @@
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
- 27167F5E13C4FA57001CC5B6 /* Build configuration list for PBXNativeTarget "CouchDemo" */ = {
+ 27167F5E13C4FA57001CC5B6 /* Build configuration list for PBXNativeTarget "GrocerySync" */ = {
isa = XCConfigurationList;
buildConfigurations = (
27167F5F13C4FA57001CC5B6 /* Debug */,
View
21 CouchDemo.xcodeproj/xcshareddata/xcschemes/CouchDemo.xcscheme
@@ -14,8 +14,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "27167F1813C4FA57001CC5B6"
- BuildableName = "CouchDemo.app"
- BlueprintName = "CouchDemo"
+ BuildableName = "GrocerySync.app"
+ BlueprintName = "GrocerySync"
ReferencedContainer = "container:CouchDemo.xcodeproj">
</BuildableReference>
</BuildActionEntry>
@@ -28,6 +28,15 @@
buildConfiguration = "Debug">
<Testables>
</Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "27167F1813C4FA57001CC5B6"
+ BuildableName = "GrocerySync.app"
+ BlueprintName = "GrocerySync"
+ ReferencedContainer = "container:CouchDemo.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.GDB"
@@ -41,8 +50,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "27167F1813C4FA57001CC5B6"
- BuildableName = "CouchDemo.app"
- BlueprintName = "CouchDemo"
+ BuildableName = "GrocerySync.app"
+ BlueprintName = "GrocerySync"
ReferencedContainer = "container:CouchDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
@@ -74,8 +83,8 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "27167F1813C4FA57001CC5B6"
- BuildableName = "CouchDemo.app"
- BlueprintName = "CouchDemo"
+ BuildableName = "GrocerySync.app"
+ BlueprintName = "GrocerySync"
ReferencedContainer = "container:CouchDemo.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
View
2 Source/DemoAppDelegate.h
@@ -19,7 +19,7 @@
//
#import <UIKit/UIKit.h>
-#import <Couchbase/CouchbaseEmbeddedServer.h>
+#import <Couchbase/CouchbaseMobile.h>
@class CouchDatabase, RootViewController;
View
33 Source/DemoAppDelegate.m
@@ -46,9 +46,6 @@ -(void)removeSplash;
@implementation DemoAppDelegate
-static CouchbaseEmbeddedServer* gCouchbaseEmbeddedServer;
-
-
@synthesize window;
@synthesize navigationController;
@synthesize database;
@@ -78,16 +75,16 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
withObject: [NSURL URLWithString: USE_REMOTE_SERVER]
afterDelay: 0.0];
#else
- gCouchbaseEmbeddedServer = [[CouchbaseEmbeddedServer alloc] init];
- gCouchbaseEmbeddedServer.delegate = self;
+ CouchbaseMobile* couchbase = [[CouchbaseMobile alloc] init];
+ couchbase.delegate = self;
#if INSTALL_CANNED_DATABASE
NSString* dbPath = [[NSBundle mainBundle] pathForResource: kDatabaseName ofType: @"couch"];
NSAssert(dbPath, @"Couldn't find "kDatabaseName".couch");
- [gCouchbaseEmbeddedServer installDefaultDatabase: dbPath];
+ [gCouchbaseMobile installDefaultDatabase: dbPath];
#endif
- if (![gCouchbaseEmbeddedServer start]) {
+ if (![couchbase start]) {
[self showAlert: @"Couldn't start Couchbase."
- error: gCouchbaseEmbeddedServer.error
+ error: couchbase.error
fatal: YES];
}
#endif
@@ -96,17 +93,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
}
--(void)couchbaseDidStart:(NSURL *)serverURL {
- NSLog(@"CouchDemo: couchbaseDidStart: <%@>", serverURL);
- if (serverURL == nil) {
- [self showAlert: @"Couldn't start Couchbase."
- error: gCouchbaseEmbeddedServer.error
- fatal: YES];
- return;
- }
-
+-(void)couchbaseMobile:(CouchbaseMobile*)couchbase didStart:(NSURL*)serverURL {
+ NSLog(@"GrocerySync: couchbaseMobile:didStart: <%@>", serverURL);
#if DEBUG
gRESTLogLevel = kRESTLogRequestURLs;
+ gCouchLogLevel = 1;
#endif
CouchServer *server = [[CouchServer alloc] initWithURL: serverURL];
@@ -129,6 +120,14 @@ -(void)couchbaseDidStart:(NSURL *)serverURL {
}
+-(void)couchbaseMobile:(CouchbaseMobile*)couchbase failedToStart:(NSError*)error {
+ NSLog(@"GrocerySync: couchbaseMobile:failedToStart: %@", error);
+ [self showAlert: @"Couldn't start Couchbase."
+ error: error
+ fatal: YES];
+}
+
+
- (void)applicationWillResignActive:(UIApplication *)application {
NSLog(@"------ applicationWillResignActive");
}
View
2 Source/RootViewController.m
@@ -24,7 +24,7 @@
#import <CouchCocoa/CouchCocoa.h>
#import <CouchCocoa/RESTBody.h>
-#import <Couchbase/CouchbaseEmbeddedServer.h>
+#import <Couchbase/CouchbaseMobile.h>
@interface RootViewController ()

0 comments on commit 57a610d

Please sign in to comment.