//? Const.h
#import
extern NSString *const NOTIRY_NAME;
@interface Const : NSObject
@end
//? Const.m
#import "Const.h"
NSString *const NOTIRY_NAME = @"NOTIRY_NAME";
@implementation Const
@end
注:
extern聲明也可以寫在@interface 中撬呢,但是參考蘋果的API沒有這樣做
//? Macro.h
#ifndef Macro_h
#define Macro_h
#define NOTIRY_NAME @"NOTIRY_NAME"
#endif /* Macro_h */