Hi,
I'm debugging a sync issue and I'm seeing a situation where the CBLDocument has been correctly updated after a sync on my iPhone from a change I made on my Mac, but the associated property on the CBLModel subclass has not updated from the sync.
Here's what a fragment of my CBLDocument looks like on my iPhone after my iPhone pulls the changes from the Mac:
(lldb) po [self.formEntry.document properties]
{
values = {
"fld-0323bba4bfa54faa924da9128e298264" = "There we are again stuff";
"fld-0c1953513df54c07ae9b30ba3c44f93e" = 1;
"fld-1ebe3f684e764f01a9278bd458852c65" = 1;
"fld-1ecbf04de9734e6198b5a0512a3d8e86" = DJ;
And here's what my CBLModel looks like for the same values property on the iPhone:
(lldb) po [self.formEntry values]
{
"fld-0323bba4bfa54faa924da9128e298264" = "There we are";
"fld-0c1953513df54c07ae9b30ba3c44f93e" = 1;
"fld-1ebe3f684e764f01a9278bd458852c65" = 1;
"fld-1ecbf04de9734e6198b5a0512a3d8e86" = DJ;
I've defined my "values" property as such:
@property (nullable, nonatomic, strong) NSDictionary *values;
And in my implementation I have values defined as @dynamic:
Notice the content in red is different. I would have expected that the values property in the CBLModel would contain the same data as the values property in the CBLDocument's properties dictionary.
This could be a source of the problem I posted earlier about losing data from a peer-to-peer sync. Because what's happening is that when I close the database and re-open it, the value that I changed to "There we are again stuff" is being replaced by the value "There we are" even though I made the change by adding "again stuff" to the string on the first device.
Do I need to force the CBLModel instances to update themselves after a sync? Or do I need to refetch them from the database in order to get updated data in my model objects?
Thanks,
Brendan