Hi,
I'm trying to check is a CBLModel is new (never being saved). However isNew is always false.
When I checked the code it makes sense because I'm passing to it a non null document. However that document is new as it was just created. Is this a bug or am I using the API in the wrong way? I just want to check if a model (or it's underliying doc) has never being saved.
Below the CBLModel code doing that:
- (instancetype) initWithDocument: (CBLDocument*)document
{
self = [super init];
if (self) {
if (document) {
LogTo(CBLModel, @"%@ initWithDocument: %@ @%p", self.class, document, document);
self.document = document;
[self didLoadFromDocument];
} else {
_isNew = true;
LogTo(CBLModel, @"%@ init", self);
}
}
return self;
}
Thanks,
Martin