Inherits from NSObject
Conforms to SFormChoiceFieldValidator
Declared in SFormChoiceFieldComparisonValidator.h
Availability
Related samples

Overview

A validator that compares the validating choice field’s input against a specified choice field’s input.

Tasks

  •   invalidMessage

    A string representing the invalid message to provide.

    property
  •   toCompare

    The choice field that we are comparing the validating choice field’s input against.

    property
  •   validResult

    The result needed from the comparison to achieve positive validation.

    property
  • – initWithFieldToCompare:validResult:

    Returns an instance of this class that will compare the validating choice field’s input against the input of a provided choice field.

Properties

invalidMessage

A string representing the invalid message to provide.

@property (nonatomic, strong) NSString *invalidMessage

Declared In

SFormChoiceFieldComparisonValidator.h

toCompare

The choice field that we are comparing the validating choice field’s input against.

@property (nonatomic, readonly, retain) SFormChoiceField *toCompare

Declared In

SFormChoiceFieldComparisonValidator.h

validResult

The result needed from the comparison to achieve positive validation.

@property (nonatomic, readonly, assign) SFormComparisonRule validResult

Declared In

SFormChoiceFieldComparisonValidator.h

Instance Methods

initWithFieldToCompare:validResult:

Returns an instance of this class that will compare the validating choice field’s input against the input of a provided choice field.

- (instancetype)initWithFieldToCompare:(SFormChoiceField *)toCompare validResult:(SFormComparisonRule)validResult

Parameters

toCompare

The choice field whose input will be compare with the validating choice field’s input.

validResult

The comparison result that trigger provide positive validation.

Discussion

This validator calls the compare: method on the field’s value property, passing in the toCompare field’s value as the parameter. This validator will validate positively if the comparison result is the same as the valid result provided.

Declared In

SFormChoiceFieldComparisonValidator.h