1
2
3
|
// Constants.h
extern NSString * const MyOwnConstant;
extern NSString * const YetAnotherConstant;
|
最后,在Constants.m
中通过赋值定义常量:
1
2
3
|
// Constants.m
NSString * const MyOwnConstant = @"myOwnConstant";
NSString * const YetAnotherConstant = @"yetAnotherConstant";
|
Objective-C 静态常量
原文:http://www.cnblogs.com/scaptain/p/4087643.html