I have an array containing CBLModel that I'd like to serialize into JSON.  
Each model object adhears to the <CBLJSONEncoding> delegate.  I'm trying to 
do it like this:

-(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);
    }
}

but that fails on with the error "Invalid type in JSON write (SBCategory)", 
SBCategory being my CBLModel object.  

-- 
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/7a4dd78c-ed93-496b-8f08-5e1482f7037d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to