Hi Jens, Thanks for the response. So is there a solution to this?
Is there a specific string date format that I should be using when storing the values in my dictionary? Is there any way to have it interpret the string and store it in the NSDictionary as an NSDate? I also need to be able to query date ranges and to be able to sort on these date values in proper chronological order (ascending and descending). But that'll happen when the secondary index is generated I guess. But still, it would need to know what date format to store in the index. In my current app I use the Unix epoch date for storing date values. But during the conversation from FMDB I'm converting the epoch date into real NSDate objects and storing them in the values NSDictionary. Thanks, Brendan On Friday, June 12, 2015 at 10:25:06 AM UTC-6, Jens Alfke wrote: > > > On Jun 12, 2015, at 2:23 AM, Brendan Duddridge <[email protected] > <javascript:>> wrote: > > It seems perhaps that they can do that only on direct properties of the > CBLModel subclass? > I am trying to persist an NSDate object that gets stored in an > NSDictionary on my CBLModel subclass. > > > Correct, it’s only for direct properties. It can do that because it has > the extra value-type metadata in the class definition, so it knows what > object class to read/write the JSON value as. > > For a random JSON value inside a dictionary or array it can’t do this. The > problem isn’t with saving, it’s with reading it back in: it just sees a > JSON string (that happens to look like a date) and can’t tell whether it's > supposed to be parsed into an NSDate or left as a string. > > —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/f302a8b8-27c1-41d6-8720-3a1346b76547%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
