Thanks Jens, that was the line I was looking for! I can't abandon JS views so this is my only option.
Thank you once again for your help. This feature could be better documented though. On Wed, May 21, 2014 at 4:23 PM, Jens Alfke <[email protected]> wrote: > > 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 a topic in the > Google Groups "Couchbase Mobile" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/mobile-couchbase/nKJeJJ0ecOA/unsubscribe > . > To unsubscribe from this group and all its topics, 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<https://groups.google.com/d/msgid/mobile-couchbase/3197CCAE-F011-4BC9-B9B5-B99BEFCF6788%40couchbase.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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/CAMxeDee0GB-faH54LsSiyKmh4z5D3QeKLHq8JhdPDu%3DnHpSmUA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
