Getting an error code of 400 when trying to create database - any thoughts?
if (!self.server)
{
self.server = [[CouchServer alloc] initWithURL: serverURL];
CouchDatabase *db = [self.server databaseNamed: kDatabaseName];
RESTOperation* op = [db create];
if (![op wait] && op.httpStatus != 412)
{ // 412 = Conflict; just means DB already exists
if (op.httpStatus != 0)
{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:kErrorDbCreateTitle
message:@"The database could not be created. Please email stubbsi@gmail.com with your details."
delegate:nil
cancelButtonTitle:@"Ok"
otherButtonTitles:nil];
alert.delegate = self;
[alert show];
}
}
I suspect the database name is illegal. CouchDB allows only *lowercase* letters, numbers and hyphens.
If you look at the error property of the operation, it probably includes a text message describing what CouchDB didn't like.
--Jens
PS: You'll get more visibility on the mobile-couchbase Google group/mailing list. This forum UI here is kind of awkward :/