-(void)saveToJSON:(NSMutableArray*)arr {
NSError *error;
self.json = [CBLJSON
dataWithJSONObject:arr
options:CBLJSONWritingPrettyPrinted
error:&error];
if (! self.json) {
NSLog(@"Got an error in Categories -> convertToJSON: %@", error);
}
}
So what's the point of - (id)initWithJSON:(id)jsonObject and - (id)encodeAsJSON then? In my mind conforming to the CBLJSONEncoding and implementing these methods would allow my object to be automatically serialized somehow, I just don't know how :-)