Full Disclosure:
I'm not an educated programmer, and the entirety of my programming experience is in Javascript and Objective-C.
So now you know what you're dealing with. Tread carefully. No sudden moves.
I'm writing an iPad app which talks to a Mac server. I'd like to use MongoDB for the backend, and ObjCMongoDB looks like the perfect fit, but I can't get it to work using the instructions here:
https://github.com/noa--/ObjCMongoDB/wiki/GettingStarted
My repro steps:
From the main ObjCMongoDB page on gitHub, click "Clone in Mac" (I'm using GitHub for Mac to handle the download)
From the command line, navigate to the ObjCMongoDB directory and type:
git submodule update
Then:
git checkout v0.9.6
copy the mongo-c-driver/src folder into the XCode Project folder
In XCode, make a new group in the Project called "ObjCMongoDB" and select it
Add the src folder from step 4 to the Project, but not to the target.
Change the name of src in the Project to mongo-c-driver
Add these files in mongo-c-driver to the target:
- bson.c
- encoding.c
- numbers.c
- mongo.c
- md5.c
- env.c
In XCode, select the ObjCMongoDB group again, and add to both the project and the target the following folders, checking "Create groups for any added folders":
- ObjCMongoDB/BSON
- ObjCMongoDB/Mongo
- ObjCMongoDB/OrderedDictionary
According to the step-by-step guide, I should be able to build & run my project now, but there are errors.
First, from MongoConnection+Diagnostics.h:
#import <ObjCMongoDB/ObjCMongoDB.h>
I don't have a Framework called ObjCMongoDB at this point, so this will obviously fail.
Even more confusing is this nifty error, followed by the API in question:
int bson_init_finished_data( bson *b, char *data, bson_bool_t ownsData ) { _bson_zero( b ); b->data = data; b->dataSize = bson_finished_data_size( data ); b->ownsData = ownsData; b->finished = 1; return BSON_OK; }
Certainly seems to expect 3 arguments...
So I'm at a loss. Any help would be greatly appreciated.