我有一个动态变化的行数的pickerView。我想在主应用程序目标中从我的模型中选择这个计数。
例如,//测试目标
#import <KIF/KIF.h>
#import "SearchModel.h" //import class from main target
@interface Acceptance_Tests : KIFTestCase
@property (nonatomic, strong) SearchModel * searchModel;
@end
@implementation Acceptance_Tests
-(void)test_01_SearchWithConditions
{
self.searchModel = [[SearchModel alloc] init];
[tester tapViewWithAccessibilityLabel:@"Search Library"];
[tester tapViewWithAccessibilityLabel:@"type_pickerView"];
//choose type
for(int i = 0; i < self.searchModel.types.count; i++)
{
[tester waitForTappableViewWithAccessibilityLabel:@"Search"];
[tester selectPickerViewRowWithTitle:[self.searchModel.types objectAtIndex:i]];
[tester tapViewWithAccessibilityLabel:@"Search"];
}
}
当我执行 Cmnd+UI 时出现错误
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_SearchModel", referenced from:
objc-class-ref in Acceptance_Tests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
我也可以将 SearchModel.m 添加到测试目标中的 Compile Cources,但这意味着我必须将所有类添加两次(在主目标和测试目标中),mm。有什么想法吗?我可以通过其他方式访问主要目标中的类吗?