1

我的实现文件中有几个常量,如下所示:

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

我在这里错过了什么吗?

4

0 回答 0