[V4CC][NEW] KVC for VCursor and VTable.

In v4.8 we adding support of Key Value Coding (KVC) to VCursor and VTable classes.

This is implemented as VCursor (KVC) category with a couple of methods:

@interface VCursor (KVC)
                // If wrong key is specified then nil is returned.
- (id)		valueForKey:(NSString *)key;

                // If wrong key is specified then nothing is changed.
- (void)	setValue:(id)value forKey:(NSString*)key;

As a key is used a field name of the cursor. As a value is used a VField.Value of that field.

It is easy to see that these methods are just wrappers to existed V4CC methods. In general, valueForKey is implemented as:

VField* fld = [myCursor fieldForName:inName];
id value = [fld value];

For details please check sources of V4CC_Cursor.KVC.mm file. In reality, valueForKey do more accurate job for Pictures and Binary fields.

So it is obvious that these KVC methods give us at least two advantages:

a) we enable VCursor/VTable classes to major Cocoa technology KVC, which is widely used.
b) you self can use these methods to simplify your code.

Published by

Ruslan Zasukhin

VP Engineering and New Technology Paradigma Software, Inc

Leave a Reply