Oh, and are the objects in the array cached at all? Or when I call 
myForm.fields will a database fetch be done every time? Or should I cache 
it myself? Or will the array simply be updated automatically if there's new 
fields coming in from a sync?

Sorry for all the questions. This is great stuff though. I just want to 
make sure that I'm using it right.

On Thursday, June 11, 2015 at 2:16:46 PM UTC-6, Brendan Duddridge wrote:
>
> Further to this topic of inverse relationships, what happens if I sync and 
> get a new TFField object coming in that should be attached to my TFForm 
> object's fields array? Will that just automatically happen? I may need to 
> add an observer on my *fields* array to fire off any KVO notifications in 
> order to update my UI with the new field(s) from the sync.
>
> On Tuesday, June 9, 2015 at 12:57:05 PM UTC-6, Brendan Duddridge wrote:
>>
>> Hi,
>>
>> Perhaps I'm missing something, but I'm following the example here for 
>> creating inverse relationships:
>>
>> https://github.com/couchbase/couchbase-lite-ios/issues/606
>>
>> I've got a similar model:
>>
>> // in interface file of TFForm class
>>
>> @property (nonatomic, strong) NSArray *fields;
>>
>> // in implementation file of TFForm class
>>
>> @dynamic fields;
>>
>> + (Class)fieldsItemClass {
>>  return [TFField class]; 
>> } 
>>
>> + (NSString *)fieldsInverseRelation { 
>>  return @"form"; 
>> }
>>
>>
>> Where TFField has a "form" property which is of type TFForm.
>>
>> 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?
>>
>> I see your example has "albums" as a read-only property. Not sure how you 
>> would add an album to an artist if the property is read-only though.
>>
>> Thanks,
>>
>> Brendan
>>
>>

-- 
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/d3bba75d-3f42-4403-a664-6c2ce76709aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to