ios public static const equiv

Jac*_*nkr 3 static constants public extern ios

我正在尝试完成C风格的版本 public static const

我已经尝试过做了什么:

ClassA.h

  • extern const int FEATURES;

ClassA.m

  • #define THE_CONST 123

ClassB.b

  • #import ClassA.h
  • initWithFrame
    • FEATURES

Xcode不是通过运行时错误,而是通过构建错误 undefined symbols for architecture i386: "_THE_CONST", referenced from: ...

我如何分享一个extern constto to for class也可以使用?

And*_*rev 11

ClassA.h

  • extern const int FEATURES;

ClassA.m

  • const int FEATURES = <your const value here>;