On Jun 4, 2014, at 7:43 AM, Nate Smith <[email protected]> wrote:
> 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 :-) CBLModel uses those. If you declare an @property in a CBLModel whose type is a class that implements CBLJSONEncoding, or whose type is an array and you specify that the item type is a class that implements CBLJSONEncoding, then CBLModel will encode/decode the objects for you. It would indeed be nice if CBLJSON could transparently encode these too. But to do that I'd have to use a custom JSON encoder instead of NSJSONSerialization, and I've been leery of doing that. --Jens -- 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/73669D8F-74F6-45F1-9BBC-678AF76B5F16%40couchbase.com. For more options, visit https://groups.google.com/d/optout.
