MJExtension 解析新浪新闻数据

一、解析的数据和模型文件

  1. 新浪新闻示例JSON数据:

http://api.sina.cn/sinago/articlev2.json?id=fxftkps3650334-comos-news-cms


2.解析文件名截图

MJExtension 解析新浪新闻数据


二、以下为部分模型文件内容示例:

//1.RJNewsCellJsonToModel.h

@interface RJNewsCellJsonToModel : NSObject

@property(nonatomic, strong) NSString *status;

@property(nonatomic, strong) RJNewsCellData *data;

@end


//2.RJNewsCellData.h

@interface RJNewsCellData : NSObject
@property(nonatomic, strong) NSString *id;
@property(nonatomic, strong) NSString *title;
@property(nonatomic, strong) NSString *long_title;
@property(nonatomic, strong) NSString *source;
@property(nonatomic, strong) NSString *link;
@property(nonatomic, strong) NSString *comments;
@property(nonatomic, strong) NSString *pub_date;
@property(nonatomic, strong) RJNewsCellDataKeys *keys;
@property(nonatomic, strong) RJNewsCellDataVM *videos_module;  //NSArray
@property(nonatomic, strong) RJNewsCellDataPics *pics;   //NSArray
@property(nonatomic, strong) NSString *content;
@property(nonatomic, strong) NSString *original_link;
@property(nonatomic, strong) NSString *share_lead;
@property(nonatomic, strong) NSString *message;
@end

//3.RJNewsCellData.m

@implementation RJNewsCellData {
}
+ (NSDictionary *)objectClassInArray
{
    return @{
              @"videos_module" : [RJNewsCellDataVMObject class],
              @"pics" : [RJNewsCellDataPicsObject class]
     };
}
@end




你可能感兴趣的:(解析,模型,MJExtension,新浪新闻)