> On Nov 10, 2014, at 9:35 AM, Christoph Berlin <[email protected]> 
> wrote:
> 
>  Its a really stupid mistake, especially because we should check whether the 
> database actually got created but the error message also threw us off. 

So your database reference is nil, and presumably when you looked up a document 
you got nil. But how did you create the model object? +modelForDocument: will 
immediately trigger an assertion failure if the document is nil, and 
-initWithNewDocumentInDatabase: also fails if database is nil.

The only way that I can see to create a CBLModel without a document is to call 
-initWithDocument: nil … but you should never call that yourself. The docs say 
"Do not call directly except from subclass initializers; to create a new 
instance call +modelForDocument: instead."

—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/FC9EBB91-7A9E-4D43-A71A-8B814F638696%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to