DAFieldDefinition

Overview

A DAFieldDefinition represents the definition of an individual field in a DADataTable. Descendant classes, such as DALookupFieldDefinition and DACalculatedFieldDefinition exist for more specialized field types, but a regular DAFieldDefinition represents a real field that is physically stored as part of the data table.

You will not usually create or deal with DAFieldDefinitions yourself, but work with fields thru the properties exposed by DADataTable and DADataTableRow. If necessary, you can query a DADataTable for a list of all defined fields via its fields property, and inspect them individually as DAFieldDefinition or subclass thereof.

Location

 

dataType

Specifies the Data Type for the field.

@property (readonly) enum DADataType dataType

dataTypeName

Returns the readable name of the fields data type, as defined by the dataType property.

@property (readonly) NSString *dataTypeName

initWithTable:

Initializes new DAFieldDefinition instance with given data table

- (id) initWithTable:(DADataTable *)ownerTable

Parameters:

  • ownerTable: owner table for new DAFieldDefinition

initWithTable:name:

Initializes a new DAFieldDefinition instance with given data table and field name.

- (id) initWithTable:(DADataTable *)ownerTable name:(NSString *)fieldName

Parameters:

  • ownerTable:
  • fieldName:

name

Specifies the uniqe name of the field within the data table. The field can be queried by this name using KVC's valueForKey: and setValue:forKey: methods on the individual DADataTableRows.

@property (readonly) NSString *name

position

Returns the position or index of the field within the data table. This is mainly for internal use; regular field access should use the name and not rely on position.

@property (readonly) NSInteger position

predicateEditorRowTemplates

Returns an array with one or more NSPredicateEditorRowTemplates that match the field definition, for use in an NSPredicateEditor. Usually, you will not call 'send this message' to an individual field, but use the DADataTable's defaultPredicateEditorRowTemplates method. See also Working with NSPredicateEditor (Xcode (Mac)).

- (NSArray *) predicateEditorRowTemplates

properties

Provides access to various properties of the field as defined in the server's Schema.

@property (readonly) NSDictionary *properties

setProperty:toValue:

Updates a property stored in the properties list.

- (void) setProperty:(NSString *)propertyName toValue:(NSString *)propertyValue

Parameters:

  • propertyName: name of the property for which we want to set new value
  • propertyValue: new value we want to set.

table

Returns a reference to the DADataTable that contains this field.

@property (readonly) DADataTable *table

visible  assign

Specifies whether this field should be visible in user interfaces. This property is not used directly by the Data Abstract framework, but can be queried by user interface code to determine whether to see the field (for example in a table view or a field picker) or not. visible will be initialized based on the value set in the Schema, server-side, but can be changed within the client, if necessary.

@property (assign) BOOL visible

 

dataType

Specifies the Data Type for the field.

@property (readonly) enum DADataType dataType

dataTypeName

Returns the readable name of the fields data type, as defined by the dataType property.

@property (readonly) NSString *dataTypeName

name

Specifies the uniqe name of the field within the data table. The field can be queried by this name using KVC's valueForKey: and setValue:forKey: methods on the individual DADataTableRows.

@property (readonly) NSString *name

position

Returns the position or index of the field within the data table. This is mainly for internal use; regular field access should use the name and not rely on position.

@property (readonly) NSInteger position

properties

Provides access to various properties of the field as defined in the server's Schema.

@property (readonly) NSDictionary *properties

table

Returns a reference to the DADataTable that contains this field.

@property (readonly) DADataTable *table

visible  assign

Specifies whether this field should be visible in user interfaces. This property is not used directly by the Data Abstract framework, but can be queried by user interface code to determine whether to see the field (for example in a table view or a field picker) or not. visible will be initialized based on the value set in the Schema, server-side, but can be changed within the client, if necessary.

@property (assign) BOOL visible

 

initWithTable:

Initializes new DAFieldDefinition instance with given data table

- (id) initWithTable:(DADataTable *)ownerTable

Parameters:

  • ownerTable: owner table for new DAFieldDefinition

initWithTable:name:

Initializes a new DAFieldDefinition instance with given data table and field name.

- (id) initWithTable:(DADataTable *)ownerTable name:(NSString *)fieldName

Parameters:

  • ownerTable:
  • fieldName:

predicateEditorRowTemplates

Returns an array with one or more NSPredicateEditorRowTemplates that match the field definition, for use in an NSPredicateEditor. Usually, you will not call 'send this message' to an individual field, but use the DADataTable's defaultPredicateEditorRowTemplates method. See also Working with NSPredicateEditor (Xcode (Mac)).

- (NSArray *) predicateEditorRowTemplates

setProperty:toValue:

Updates a property stored in the properties list.

- (void) setProperty:(NSString *)propertyName toValue:(NSString *)propertyValue

Parameters:

  • propertyName: name of the property for which we want to set new value
  • propertyValue: new value we want to set.

Descendants

See Also