首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >斯威夫特ResearchKit HealthKit QuestionStep

斯威夫特ResearchKit HealthKit QuestionStep
EN

Stack Overflow用户
提问于 2015-07-03 20:51:51
回答 1查看 184关注 0票数 0

我目前正在开发一个基于ResearchKit框架(在objective中编写)的医学研究应用。我目前正在尝试用一个HealthKit问题来创建一个调查。我现在的代码是:

代码语言:javascript
复制
    let genderAnswerFormat = ORKHealthKitCharacteristicTypeAnswerFormat(characteristicType: HKCharacteristicTypeIdentifierBiologicalSex)
    let genderQuestionStepTitle = "What is your gender?"
    let genderQuestionStep = ORKQuestionStep(identifier: "genderQuestionStep", title: genderQuestionStepTitle, answer: genderAnswerFormat)
    steps += [genderQuestionStep]

但是,第一行将导致一个错误:

无法找到接受类型为“(ORKHealthKitCharacteristicTypeAnswerFormat:String)”的参数列表的“ORKHealthKitCharacteristicTypeAnswerFormat”初始化器

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-04 00:13:19

您需要将标识符转换为HKObjectType,这是初始化程序的预期参数类型。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31214072

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档