I do this at the beginning before I query the database, so I think so:

CBLDatabase *database = self.document.couchDatabase;


 // Do this once per launch, probably right after opening the database:

CBLModelFactory* factory = database.modelFactory;

[factory registerClass:[TFForm class] forDocumentType: @"TFForm"];

[factory registerClass:[TFField class] forDocumentType: @"TFField"];

[factory registerClass:[TFCategory class] forDocumentType: @"TFCategory"];

[factory registerClass:[TFSearch class] forDocumentType: @"TFSearch"];

[factory registerClass:[TFPickList class] forDocumentType: @"TFPickList"];

[factory registerClass:[TFFormLayout class] forDocumentType: @"TFFormLayout"
];

[factory registerClass:[TFFormEntry class] forDocumentType:@"TFFormEntry"];



On Wednesday, June 10, 2015 at 10:11:09 PM UTC-6, Jens Alfke wrote:
>
>
> On Jun 9, 2015, at 11:57 AM, Brendan Duddridge <bren...@gmail.com 
> <javascript:>> wrote:
>
> When I access a TFForm instance and try to log the "fields" property, I 
> get null back. Should it automatically create a view and a query for that? 
> Or do I have to do it all manually by creating my own view and query?
>
>
> No, you don’t have to create a view.
>
> Have you got the types for those model classes registered with the 
> ModelFactory?
>
> —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 mobile-couchbase+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/c64caecf-f411-4ffd-98fd-3f21eaa6bf7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to