ORKTaskResultSource Protocol Reference
Conforms to | NSObject |
---|---|
Declared in | ORKCollectionResult.h |
ORKTaskResultSource
is the protocol for [ORKTaskViewController defaultResultSource]
.
– stepResultForStepIdentifier:
required method
Returns a step result for the specified step identifier, if one exists.
- (nullable ORKStepResult *)stepResultForStepIdentifier:(NSString *)stepIdentifier
Parameters
stepIdentifier |
The identifier for which to search. |
---|
Return Value
The result for the specified step, or nil
for none.
Discussion
When it’s about to present a step, the task view controller needs to look up a
suitable default answer. The answer can be used to prepopulate a survey with
the results obtained on a previous run of the same task, by passing an
ORKTaskResult
object (which itself implements this protocol).
Declared In
ORKCollectionResult.h
– alwaysCheckForDefaultResult
Should the default result store be used even if there is a previous result? (due to reverse navigation or looping)
- (BOOL)alwaysCheckForDefaultResult
Return Value
YES
if the default result should be given priority over the previous result.
Discussion
By default, the [ORKTaskViewController defaultResultSource]
is only queried for a
result if the previous result is nil. This allows the result source to override that
default behavior.
Declared In
ORKCollectionResult.h