my_map from CBL source

19 views
Skip to first unread message

Todd Freese

unread,
Feb 25, 2014, 11:05:48 AM2/25/14
to mobile-c...@googlegroups.com
I lifted some code from the CBL source and I am having troubles with getting method call to build.

The code is calling the my_map method from CollectionUtils.h and it can't find this method.

I'm calling #import <CouchbaseLite/CouchbaseLite.h> which I would think would import all the necessary files.
I tried #import <CouchbaseLite/CollectionUtils.h> but no luck.

What I'm I missing?

Todd

Jens Alfke

unread,
Feb 25, 2014, 2:39:09 PM2/25/14
to mobile-c...@googlegroups.com

On Feb 25, 2014, at 8:05 AM, Todd Freese <to...@filmworkers.com> wrote:

> The code is calling the my_map method from CollectionUtils.h and it can't find this method.

It’s in CollectionUtils.h, inside the Couchbase Lite sources.

> I'm calling #import <CouchbaseLite/CouchbaseLite.h> which I would think would import all the necessary files.
> I tried #import <CouchbaseLite/CollectionUtils.h> but no luck.

Nope. The CBL source code has lots of internal headers and source files and private APIs. That’s one of them.

It’s not hard to replace my_map. It’s a typical ‘map’ operation: it calls the block on every element of the array and collects the return values into a new array. You can easily rewrite that as a standard for loop.

—Jens

Reply all
Reply to author
Forward
0 new messages