json数据解析
Posted 丹丹Jordan
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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生成对象:
以上是关于json数据解析的主要内容,如果未能解决你的问题,请参考以下文章