Integrating Grocery Sync example


#1

I’m having issues integrating the Grocery Sync app to my iOS project. The project is a mix of C++ and Objective C. I’ve got it all compiling and running, but it seems that my document is not saving. I can’t get any log output even though I have set

[CBLManager enableLogging: @"Database"];
[CBLManager enableLogging: @"Query"];

I can see log output from NSLog.

The result of [doc putProperties: document error: &error] shows null for both doc.properties and error.
What would be good places to look to help debug the issue?


#2

Probably doc is nil.

If NSLog doesn’t work, something’s pretty wrong … I’d focus on that first.


#3

I was mistaken about that - NSLog does work.
Yes you’re right, CBLDocument* doc = [database createDocument]; is returning nil.
Can I check for an error there?


#4

-createDocument should never return nil. Check whether database is nil.


#5

Thanks - that was it - I’d not passed in the database instance from the delegate object.