ibc++abi.dylib: terminating with uncaught exception of type NSException. Again:(
<p>I know that this question was asked so many times and I read answers, but still can't fix my problem.
So, here is <strong>class SurveyTask</strong>.</p>

<pre><code>public class SurveyTask: NSObject, ORKTask {

let introStepID = "intro_step"
let nameStepID = "name_step"
let questStepID = "quest_step"
let colorStepID = "color_step"
let summaryStepID = "summary_step"

public var identifier: String { get { return "survey"} }

public func stepBeforeStep(step: ORKStep?, withResult result: ORKTaskResult) -&gt; ORKStep? {

    switch step?.identifier {
    case .Some(nameStepID):
        return stepWithIdentifier(introStepID)

    case .Some(questStepID):
        return stepWithIdentifier(nameStepID)

    case .Some(summaryStepID):
        return questStep(findName(result))

    default:
        return nil
    }
}

public func stepAfterStep(step: ORKStep?, withResult result: ORKTaskResult) -&gt; ORKStep? {

    switch step?.identifier {
    case .None:
        return stepWithIdentifier(introStepID)

    case .Some(introStepID):
        return stepWithIdentifier(nameStepID)

    case .Some(nameStepID):
        return questStep(findName(result))

    case .Some(questStepID):
        return stepWithIdentifier(summaryStepID)

    default:
        return nil
    }
}

public func stepWithIdentifier(identifier: String) -&gt; ORKStep? {
    switch identifier {

    case introStepID:
        let instructionStep = ORKInstructionStep(identifier: introStepID)
        instructionStep.title = "The Questions Three"
        instructionStep.text = "Who would cross the Bridge of Death must answer me these questions three, ere the other side they see."
        return instructionStep

    case nameStepID:
        let nameAnswerFormat = ORKTextAnswerFormat(maximumLength: 20)
        nameAnswerFormat.multipleLines = false
        let nameQuestionStepTitle = "What is your name?"
        return ORKQuestionStep(identifier: nameStepID, title: nameQuestionStepTitle, answer: nameAnswerFormat)

    case questStepID:
        return questStep("")

    case summaryStepID:
        let summaryStep = ORKCompletionStep(identifier: "SummaryStep")
        summaryStep.title = "Right. Off you go!"
        summaryStep.text = "That was easy!"
        return summaryStep

    default:
        return nil
    }
}

func findName(result: ORKTaskResult) -&gt; String? {

    if let stepResult = result.resultForIdentifier(nameStepID) as? ORKStepResult, let subResults = stepResult.results, let textQuestionResult = subResults[0] as? ORKTextQuestionResult {

        return textQuestionResult.textAnswer
    }
    return nil
}

func questStep(name: String?) -&gt; ORKStep {

    var questQuestionStepTitle = "What is your quest?"

    if let name = name {
        questQuestionStepTitle = "What is your quest, \(name)?"
    }

    let textChoices = [
        ORKTextChoice(text: "Create a ResearchKit App", value: 0),
        ORKTextChoice(text: "Seek the Holy Grail", value: 1),
        ORKTextChoice(text: "Find a shrubbery", value: 2)
    ]
    let questAnswerFormat: ORKTextChoiceAnswerFormat = ORKAnswerFormat.choiceAnswerFormatWithStyle(.SingleChoice, textChoices: textChoices)
    return ORKQuestionStep(identifier: questStepID, title: questQuestionStepTitle, answer: questAnswerFormat)
}}
</code></pre>

<p>In <strong>viewController</strong>:</p>

<pre><code>override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    guard let activity = Activity(rawValue: indexPath.row) else { return }

    let taskViewController: ORKTaskViewController
    switch activity {
        case .Survey:
            taskViewController = ORKTaskViewController(task: SurveyTask(), taskRunUUID: nil)
        }
    taskViewController.delegate = self
    navigationController?.presentViewController(taskViewController, animated: true, completion: nil)
}
</code></pre>

<p>And when I Build&amp;Run my project and push on Survey it started(!) and I see first step from survey, but when I tapped "Get started" It stopped on condition in <strong>findName</strong> function(I added an image to better show where it stopped <a href="http://upload.akusherstvo.ru/image1020309.png" rel="nofollow">http://upload.akusherstvo.ru/image1020309.png</a>):</p>

<pre><code>func findName(result: ORKTaskResult) -&gt; String? {

    if let stepResult = result.resultForIdentifier(nameStepID) as? ORKStepResult, let subResults = stepResult.results, let textQuestionResult = subResults[0] as? ORKTextQuestionResult {//////here

        return textQuestionResult.textAnswer
    }
    return nil
}
</code></pre>

<p>You are right, @conarch, an array, which I'm trying to access is really empty. But I can't understand why it is empty. I want to do a "dependent" survey(the answer to the previous question determines what would be the next question). For that I need to get result of question.</p>