Objective-Cでグローバル定数を定義したファイルをPrefix.pchでインポートする方法 < MyConstant.h #undef _EXTERN #undef _INITIALIZE_AS #ifdef _DEFINE_GROBAL_CONSTS_ #define _EXTERN #define _INITIALIZE_AS(x) =x #else #define _EXTERN extern #define _INITIALIZE_AS(x) #endif _EXTERN NSString* const kAddMessageNotification _INITIALIZE_AS(@"addMessage"); MyConstant.m #define _DEFINE_GROBAL_CONSTS_ 1 #import "RRGConstant.h" Prefix.pch #import "MyConstant.h" MyConstant.m #define _DEFINE_GROBAL_CONSTS_ 1 MyConstant.h Prefix.pch Undefined symbols for architecture arm64: "_kAddMessageNotification", referenced from: ... Prefix.pch
MyConstant.m`Compiler Flags``-D _DEFINE_GROBAL_CONSTS_=1`
!
xcX3v84RxoQ-4GxG32940ukFUIEgYdPy
063f45ed81855c5109fe4608dbc9da24
Stop