0
我目前正在基於ResearchKit框架(它是用Objective-C編寫的)在swift中開發醫學研究應用程序。我目前正在嘗試用HealthKit問題創建一項調查。我現在有作爲的代碼是:Swift ResearchKit HealthKit問題步驟
let genderAnswerFormat = ORKHealthKitCharacteristicTypeAnswerFormat(characteristicType: HKCharacteristicTypeIdentifierBiologicalSex)
let genderQuestionStepTitle = "What is your gender?"
let genderQuestionStep = ORKQuestionStep(identifier: "genderQuestionStep", title: genderQuestionStepTitle, answer: genderAnswerFormat)
steps += [genderQuestionStep]
然而,第一行會導致錯誤:
無法找到接受型characteristicType的「(參數列表「ORKHealthKitCharacteristicTypeAnswerFormat」的初始化:字符串)'