TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | Custom |
ReleasedLast Release | May 2014 |
Maintained by Unclaimed.
CouchCocoa is a medium-level Objective-C API for working with TouchDB and CouchDB on iOS and Mac OS. By "medium-level" we mean:
This API is not the only way to access CouchDB or TouchDB -- if you prefer, you can go down to the metal and talk to the HTTP API yourself using NSURLConnection.
Xcode 4.3 or later, with the SDK for iOS 4.3 or later.
If you cloned the CouchCocoa Git repository, aso opposed to downloading a precompiled framework, then you'll next need to initialize Git "submodules". This will clone the dependency JSONKit into the "vendor" subfolder:
cd CouchCocoa
git submodule init
git submodule update
Our iOS demo, "Grocery Sync", has its own GitHub repository. Check it out and look at its README for instructions.
There are two simple Mac demo apps included in the Demo/ subfolder. One lets you edit a simple list of names and email addresses, the other is a shopping list. (They actually share most of the same source code; all the differences are in their model classes and .xib files, thanks to the magic of Cocoa bindings.) To run them:
(You only need to do this if you checked out the CouchCocoa source code and want to build it yourself. If you downloaded a precompiled framework, just go onto the next section.)
If you want to run the unit tests, first make sure a CouchDB server is running on localhost, then choose Product > Test.
The framework will be located at:
(The exact location of build
itself will depend on your Xcode preferences. It may be a subdirectory of the project folder, or it may be located down in an Xcode "DerivedData" folder. One way to find the framework is to open up the Products
group in the project navigator, right-click on the appropriate CouchCocoa.framework
, and choose "Show In Finder".)
You'll probably want to run a local database server on your iOS device, since it'll allow your app to work offline (and improves performance.) CouchCocoa.framework doesn't contain CouchDB itself, so you should also add the Couchbase Mobile framework to your app. Using the two together is very simple: when the CouchbaseMobile object calls your delegate method to tell you the server's up and running, just use the URL it gives you to instantiate a CouchServer object.
Released under the Apache license, version 2.0.
Author: Jens Alfke
With contributions from: J Chris Anderson, David Venable, Alex McArthur, Jonathon Mah, Pierre Metrailler, Sven A. Schmidt, Katrin Apel.
Copyright 2012, Couchbase, Inc.