I have a pickerView with dynamically changing number of rows. I want to choose this count from my model in the main app target.
For example, //test target
#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"];
}
}
When I do Cmnd+U I get an error
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)
Also I can add SearchModel.m to the Compile Cources in the test target, but that means I must add all classes twice (in the main target and in the test target), mm. Any thoughts? Can I get access to the classes in main target by another way ?
The compile error tells you what's wrong. You are running the KIF tests in x64 mode (check your architectures and valid architectures in build_settings. Do you have arm64 in there?) your target app probably doesn't have the same architecture settings.
To start, I would make sure the architecture settings are identical between your KIF test target and your app.