我有一个 .m 文件,其中包含一些常量,我试图将其包含在 podspec 的源文件中:
s.source_files = 'GBToolbox/GBConstants_Common.{h,m}',
...
但是在构建应用程序时,我得到一个未找到符号的错误:
Undefined symbols for architecture i386:
"_kSomeConst", referenced from:
_DataForObject in APIProxy.o
...
源文件的样子,标题:
//GBConstants_Common.m
extern NSUInteger const kSomeConstant;
执行:
//GBConstants_Common.m
#import "GBConstants_Common.h"
NSUInteger const kSomeConstant = 42;
有什么想法可能导致这种情况吗?