Hi Jens, I think I'll need to create some sort of "proxy" class to represent the model object. Because I need to intermix text and tokens, so there would be no way to distinguish a token from text if the tokens were just instances of NSString.
Right now I have a TFField class that I was trying to encode and I think I'll just create a TFFieldProxy class and use that to convert between the document ID to real TFField objects. Thanks, Brendan On Wednesday, August 5, 2015 at 12:57:17 PM UTC-6, Jens Alfke wrote: > > > On Aug 5, 2015, at 11:30 AM, Brendan Duddridge <[email protected] > <javascript:>> wrote: > > When I try to implement encodeWithCoder and initWithCoder, I am unable to > call super and I also get the following error from CBL: > > > Oh, interesting. Yeah, making models encodable is problematic because they > should be unique — there should only be one CBLModel instance corresponding > to a specific document. Whereas if you could encode/decode them, you could > easily end up with duplicates (encode a model, then decode it — now you > have two of it.) > > I suggest making the token objects just be stubs — for example, use the > document ID (an NSString) as the token. It’s easy to map between that and > the model object in either direction. > > —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/b5cbab2a-6030-4b59-ae91-2eb29fd7f507%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
