Objective-C枚举
#import <Foundation/Foundation.h>
typedef enum{
custom = 0,//自定义
login,//登陆
wallet,//钱包
certificate,//证件
account,//帐号
workAndLife//生活工作
}GroupType;
@interface AccountType : NSObject
@property(nonatomic,assign)int ID;//主键
@property(nonatomic,retain)NSString *type;//类型名称
@property(nonatomic,assign)int stor;//排序
@property(nonatomic,assign)GroupType groupId;//分组类型
@property(nonatomic,assign)BOOL isTemplate;//是否为模版
-(NSMutableDictionary *)toDic:(AccountType *)model;
-(NSString *)toJSON:(AccountType *)model;
@end
本文介绍了Objective-C中使用枚举定义不同类型的账户分组,并展示了如何通过@interface声明对象属性,包括账户ID、类型名称等。同时,提供了将模型转换为字典和JSON字符串的方法。

102

被折叠的 条评论
为什么被折叠?



