ORKTaskResult Class Reference

Inherits from ORKCollectionResult : ORKResult : NSObject
Conforms to ORKTaskResultSource
Declared in ORKCollectionResult.h

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.

– initWithTaskIdentifier:taskRunUUID:outputDirectory:

Returns an intialized task result using the specified identifiers and directory.

- (instancetype)initWithTaskIdentifier:(NSString *)identifier taskRunUUID:(NSUUID *)taskRunUUID outputDirectory:(nullable NSURL *)outputDirectory

Parameters

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 *taskRunUUID

Discussion

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 *outputDirectory

Discussion

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