Objective c 从控制器实现文件引用测试实现文件中的常量
我的实现文件中有几个常量,如下所示:Objective c 从控制器实现文件引用测试实现文件中的常量,objective-c,testing,constants,xcode5,ios6.1,Objective C,Testing,Constants,Xcode5,Ios6.1,我的实现文件中有几个常量,如下所示: static const NSInteger kBookSectionCount = 3; static const NSInteger kBookPopoverHeight = 400; static NSString *kBookValue = @"Test Value"; extern const NSInteger kBookSectionCount; extern const NSInteger kBookPopoverHeight; exter
static const NSInteger kBookSectionCount = 3;
static const NSInteger kBookPopoverHeight = 400;
static NSString *kBookValue = @"Test Value";
extern const NSInteger kBookSectionCount;
extern const NSInteger kBookPopoverHeight;
extern NSString *kBookValue;
我想在我的测试实现文件中引用这些常量。我能做吗?我尝试了以下方法:
static const NSInteger kBookSectionCount = 3;
static const NSInteger kBookPopoverHeight = 400;
static NSString *kBookValue = @"Test Value";
extern const NSInteger kBookSectionCount;
extern const NSInteger kBookPopoverHeight;
extern NSString *kBookValue;
尝试上述方法时,我遇到以下错误:
Undefined symbols for architecture i386:
"_kBookSectionCount", referenced from:
-[myClassTest testNumberOfSections] in myClass.o
我是不是遗漏了什么