json数据解析
1、ESJson Format和JSonModel配合使用自动生成的数据model
AppealListModel.h文件
#import <Foundation/Foundation.h>
@class ComplaintlistItem;
@interface AppealListModel : NSObject
@property (nonatomic, assign) NSInteger IsSuccess;
@property (nonatomic, assign) NSInteger RecordCount;
@property (nonatomic, copy) NSString *ErrorMessage;
@property (nonatomic, strong) NSArray<ComplaintlistItem *> *ComplaintList;
@end
@interface ComplaintlistItem : NSObject
@property (nonatomic, copy) NSString *OrderID;
@property (nonatomic, copy) NSString *YzName;
@property (nonatomic, copy) NSString *ComplaintStateName;
@property (nonatomic, assign) NSInteger ComplaintID;
@property (nonatomic, assign) NSInteger Frequency;
@property (nonatomic, copy) NSString *Content;
@property (nonatomic, assign) NSInteger ComplaintState;
@property (nonatomic, copy) NSString *CreateTime;
@end
AppealListModel.m文件
#import "AppealListModel.h"
@implementation AppealListModel
+ (NSDictionary *)objectClassInArray{
return @{@"ComplaintList" : [ComplaintlistItem class]};
}
@end
@implementation ComplaintlistItem
@end
2、JSonModel生成对象: