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

-- 
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/d331b662-6769-4514-bcb0-6d0035d5a438%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to