ORKTimeIntervalAnswerFormat Class Reference
Inherits from | ORKAnswerFormat : NSObject |
---|---|
Declared in | ORKAnswerFormat.h ORKAnswerFormat.m |
Overview
The ORKTimeIntervalAnswerFormat
class represents the answer format for questions that ask users
to specify a time interval.
The time interval answer format is suitable for time intervals up to 24 hours. If you need to track
time intervals of longer duration, use a different answer format, such as
ORKValuePickerAnswerFormat
.
Note that the time interval answer format does not support the selection of 0.
A time interval answer format produces an ORKTimeIntervalQuestionResult
object.
Other Methods
– initWithDefaultInterval:step:
Returns an initialized time interval answer format using the specified default interval and step value.
- (instancetype)initWithDefaultInterval:(NSTimeInterval)defaultInterval step:(NSInteger)step
Parameters
defaultInterval |
The default value to display in the picker. |
---|---|
step |
The step in the interval, in minutes. The value of this parameter must be between 1 and 30. |
Return Value
An initialized time interval answer format.
Discussion
This method is the designated initializer.
Declared In
ORKAnswerFormat.h
defaultInterval
The initial time interval displayed in the picker.
@property (readonly) NSTimeInterval defaultInterval
Declared In
ORKAnswerFormat.h
step
The size of the allowed step in the interval, in minutes.
@property (readonly) NSInteger step
Discussion
By default, the value of this property is 1. The minimum value is 1, and the maximum value is 30.
Declared In
ORKAnswerFormat.h
Other Methods
– questionType
The type of question. (read-only)
- (ORKQuestionType)questionType
Discussion
You can use this enumerated value in your Objective-C code to switch on a rough approximation of the type of question that is being asked.
Note that answer format subclasses override the getter to return the appropriate question type.
Declared In
ORKAnswerFormat.h
– validateParameters
Validates the parameters of the answer format to ensure that they can be displayed.
- (void)validateParameters
Discussion
Typically, this method is called by the validation methods of the owning objects, which are themselves called when a step view controller that contains this answer format is about to be displayed.
Declared In
ORKAnswerFormat.h