ios的常量推荐写法有两种,一种是用宏定义。
// Constants.h
#define kRoot @"kRoot"
#define gMax (12)
一种是用类
// Constants.h
extern NSString * const kRoot;
// Constants.m
NSString * const kRoot = @"kRoot";
ios的常量推荐写法有两种,一种是用宏定义。
// Constants.h
#define kRoot @"kRoot"
#define gMax (12)
一种是用类
// Constants.h
extern NSString * const kRoot;
// Constants.m
NSString * const kRoot = @"kRoot";