On May 21, 2014, at 12:52 AM, Matija Alanović <[email protected]> wrote:
> I've got a working Javascript view on Cloudant. It's called "messages" and
> it's in a design document with an ID "_design/desdoc". I'd like to use it on
> iOS too.
Only the REST API looks up and compiles view source code from design documents.
If you’re using the native API you’ll have to do it yourself. Once you have the
JS source code, call
CBLMapBlock mapBlock = [[CBLView compiler] compileMapFunction:
mapSource language: @"javascript”];
Then you can use that block to register the view’s map function.
I didn’t expect people to use JS views in native apps, to be honest; this
feature was implemented for use with PhoneGap. The performance is going to be a
lot worse than a native function, so IMHO it’s worth the effort to rewrite your
map function in Objective-C.
—Jens
--
You received this message because you are subscribed to the Google Groups
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/mobile-couchbase/3197CCAE-F011-4BC9-B9B5-B99BEFCF6788%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.