- MagicalRecord has good reputation as a framework that further abstracts CoreData goodness. So when thinking about the "RestKit to CoreData" piece, it is only natural to get excited about news like: RestKit is built, in part, on top of MagicalRecord !!!
-
CoreData is desirable because of classes like NSFetchedResultsController.h which help to efficiently manage the results returned from a Core Data fetch request. Have a look at the comments for that class and it makes its own usefulness painfully apparent.
- Now CoreData is built upon DataSources such as SQL-lite so I feel that there is an inherent difference in the query language of CoreData which has been written for relational databases versus nosql DBs like CouchDB … but I could be wrong about this and need to collect the opinions of others in the dev community on this matter.
-
If all I'm worried about is the smoothness with which a UITableView updates when used solely against an embedded CouchMobile/TouchDB/SyncPoint instance then I should get and see what it the user experience for the GrocerySync app feels like.
- Look at CouchUITableSource
- Based on https://github.com/couchbaselabs/TouchDB-iOS/wiki/FAQ:
- Couchbase Mobile 2.0 is implemented in an interpreted language (Erlang) whose runtime library needs to be bundled in. This make me think that IF CouchCocoa is the client interfacing with it then CouchUITableSource ends up helping out the same way as NSFetchedResultsController.
- TouchDB is inherently different because it’s using SQL for storage, rather than a custom append-only B-tree implementation. Does this mean that it far better suited for a head on CoreData integration + optimization? *Shrug* ... anyway CouchUITableSource is still there to help for now.
Showing posts with label CouchCocoa. Show all posts
Showing posts with label CouchCocoa. Show all posts
Monday, March 26, 2012
How to combine: IrisCouch to CouchCocoa to RestKit to CoreData to TouchDB?
Tuesday, February 28, 2012
IrisCouch and CouchCocoa
- Here's some sample code that can be thrown directly into your iPhone application's application:didFinishLaunchingWithOptions: method, in order to perform a basic connectivity test for your IrisCouch domain.
- You may refer to this post to get CouchCocoa into your iOS project.
- If you see error messages such as the following in your Xcode console then you are well on your way:
- As mentioned by in this thread, simply make the following changes to your IrisCouch domain:
- Go to http://mydomain.iriscouch.com/_utils/
- Log into your account
- Click “Configuration” in the sidebar
- Click “Add a new section” at the bottom
- Fill in
- section: httpd
- option: WWW-Authenticate
- value: Basic realm="administrator"
- It should work well now and after you spot the following logs, you can go confirm that a new database has actually been created on IrisCouch via your /_utils/ web console.
Labels:
authentication,
authN,
CouchCocoa,
IrisCouch
Wednesday, February 22, 2012
CouchCocoa - An iOS client for working with CouchDB
CouchCocoa is a framework / library for iPhone use that abstracts out the work needed to talk to CouchDB instances running on the web or on the device itself.
If you want to jump right into the setup for a simple project, then simply follow these steps:
Aside from the process there are some "big picture" points to consider:
- Add CouchCocoa as a submodule to your project:
- cd ~/dev/myProject/
- git submodule add git://github.com/couchbaselabs/CouchCocoa.git
- Get all the dependencies of this submodule itself:
- cd ~/dev/myProject/CouchCocoa/
- git submodule update --init --recursive
- Drag & drop CouchCocoa's .xcodeproj file under your own project in Xcode
- Add the following as your target's dependencies so that they will get built:
- iOS Framework (CouchCocoa)
- iOS Library (CouchCocoa)
- Add the following in "Link Binary With Libraries" for your target:
- libCouchCocoa.a
- Add the following in "Header Search Paths" for your target:
- "$(SRCROOT)/CouchCocoa/Model"
- "$(SRCROOT)/CouchCocoa/REST"
- "$(SRCROOT)/CouchCocoa/Couch"
- "$(SRCROOT)/CouchCocoa/UI/iOS"
- In Xcode, select CouchCocoa.xcodeproj in the Project Navigator and edit the Target > Build Settings and set the Skip Install setting to Yes.
-
If at a later point of time you realize that you want to work with TouchDB as well then you *may* need to update your CouchCocoa submodule and bring it up to speed:
- cd ~/dev/myProject/CouchCocoa/
- git checkout touchdb
- git pull origin touchdb
Aside from the process there are some "big picture" points to consider:
- CouchCocoa can talk directly to CouchDB (or CouchBase - a more performant variant). For example, if you use the hosting services provided by IrisCouch, you can configure CouchCocoa to work directly with that Couch server.
-
CouchCocoa can work with an embedded version of CouchDB on mobile devices.
- TouchDB is one such implementation which is lightweight and exists for iOS and Android mobile devices.
- For iOS however, I do find it a bit confusing when I think about how to structure my project, there are two ways to do it:
-
Build and soft-link the TouchDB framework. And use CouchCocoa as a submodule as outlined earlier in the blog.
-
If you choose to use TouchDB-iOS as a submodule as well then don't forget that TouchDB's itself also needs a soft-link to CouchCocoa.framework:
cd ~/dev/superProject
ln -s ./DerivedData/superProject/Build/Products/Debug-ios-universal/CouchCocoa.framework ./TouchDB-iOS/Demo-iOS/Frameworks/CouchCocoa.framework
-
If you choose to use TouchDB-iOS as a submodule as well then don't forget that TouchDB's itself also needs a soft-link to CouchCocoa.framework:
- Syncpoint-iOS which bundles TouchDB and CouchCocoa together but lags behind the individual projects in terms of stability and features. To experiment with it, you can follow a this discussion thread where it was introduced to the community.
-
Build and soft-link the TouchDB framework. And use CouchCocoa as a submodule as outlined earlier in the blog.
- Another huge pain-point is the fact that for all of GitHub's glory it doesn't let me search for content in wiki pages so when it comes time to try out the infamous Grocery-Sync example, I'm left wondering where to look! This relative path should shed some light I hope: TouchDB-iOS/Demo-iOS/DemoAppDelegate.m
- For iOS however, I do find it a bit confusing when I think about how to structure my project, there are two ways to do it:
- Couchbase Mobile is another implementation. Recently it has seen some serious progress in terms of tutorials (one & two) and example-code covering its usage.
- TouchDB is one such implementation which is lightweight and exists for iOS and Android mobile devices.
Labels:
client,
CouchCocoa,
CouchDB,
iOS,
iPhone,
ObjC,
Objective C,
TouchDB
Subscribe to:
Posts (Atom)