ORKTaskResult Class Reference
| Inherits from | ORKCollectionResult : ORKResult : NSObject |
|---|---|
| Conforms to | ORKTaskResultSource |
| Declared in | ORKCollectionResult.h ORKCollectionResult.m |
Overview
An ORKTaskResult object is a collection result that contains all the step results
generated from one run of a task or ordered task (that is, ORKTask or ORKOrderedTask) in a task view controller.
A task result is typically generated by the framework as the task proceeds. When the task completes, it may be appropriate to serialize it for transmission to a server, or to immediately perform analysis on it.
The results property of the ORKCollectionResult object contains the step results
for the task.
Other Methods
– initWithTaskIdentifier:taskRunUUID:outputDirectory:
Returns an intialized task result using the specified identifiers and directory.
- (instancetype)initWithTaskIdentifier:(NSString *)identifier taskRunUUID:(NSUUID *)taskRunUUID outputDirectory:(nullable NSURL *)outputDirectoryParameters
identifier |
The identifier of the task that produced this result. |
|---|---|
taskRunUUID |
The UUID of the run of the task that produced this result. |
outputDirectory |
The directory in which any files referenced by results can be found. |
Return Value
An initialized task result.
Declared In
ORKCollectionResult.h
taskRunUUID
A unique identifier (UUID) for the presentation of the task that generated the result.
@property (nonatomic, copy, readonly) NSUUID *taskRunUUIDDiscussion
The unique identifier for a run of the task typically comes directly from the task view controller that was used to run the task.
Declared In
ORKCollectionResult.h
outputDirectory
The directory in which the generated data files were stored while the task was run.
@property (nonatomic, copy, readonly, nullable) NSURL *outputDirectoryDiscussion
The directory comes directly from the task view controller that was used to run this task. Generally, when archiving the results of a task, it is useful to archive all the files found in the output directory.
The file URL also prefixes the file URLs referenced in any child
ORKFileResult objects.
Declared In
ORKCollectionResult.h
Other Methods
– stepResultForStepIdentifier:
Returns a step result for the specified step identifier, if one exists.
- (ORKStepResult *)stepResultForStepIdentifier:(NSString *)stepIdentifierParameters
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