3

我正在研究一些使用 ResearchKit 的原型。当我使用 iP6 或模拟器从 XCode 运行应用程序时,一切都很好。当我尝试归档我的应用程序时出现错误。

我收到以下错误:

Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_ORKQuestionStepCellHolderView", referenced from:
     _OBJC_CLASS_$__TtC6myapp11MyCustomView in MyCustomView.o
"_OBJC_METACLASS_$_ORKQuestionStepCellHolderView", referenced from:
    _OBJC_METACLASS_$__TtC6myapp11MyCustomView in MyCustomView.o
ld: symbol(s) not found for architecture arm64 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我按照这些说明将 ResearchKit 包含到我的项目中。我尝试下载源代码(我正在使用“稳定”分支),将项目拖到我的项目中,构建 RK 框架,然后将其添加为嵌入式二进制文件。主要问题是从ORKQuestionStepCellHolderView继承的自定义类。如果我摆脱了这个自定义类,我的错误就会消失,并且我可以归档我的应用程序。

ORKQuestionStepCellHolderView 在 ORKCustomStepView.h 和 .m 文件中定义。

关于我为什么会遇到这个问题并且只使用这个特定的类(ORKQuestionStepCellHolderView)的任何线索?任何帮助都感激不尽!!

顺便说一句,我使用的是 XCode 7.3.1,我的项目主要使用 Swift。不确定这是否与此事有关,但也许有帮助。

更新 我终于能够通过更新 ResearchKit 代码来归档应用程序:

@interface ORKQuestionStepCellHolderView : ORKQuestionStepCustomView
@property (nonatomic, strong, nullable) ORKSurveyAnswerCell *cell;
@end

对此:

ORK_CLASS_AVAILABLE
@interface ORKQuestionStepCellHolderView : ORKQuestionStepCustomView
@property (nonatomic, strong, nullable) ORKSurveyAnswerCell *cell;
@end

我刚刚在这里发布了一个问题,看看这是一个错误还是只是我从错误的角度解决了我的问题。

试图了解 ORK_CLASS_AVAILABLE 是什么,我最终阅读了这个关于符号可见性的链接。

UPDATE & ANSWER YuanZhu-apple在这里向我证实我的方法是正确的,而且这绝对是 ResearchKit 中的一个错误,所以我将发布一个 PR。

4

0 回答 0