// ProductModel.h
// JSONModel
//
// Created by 张国锋 on 15/7/20.
// Copyright (c) 2015年 张国锋. All rights reserved.
//
#import "JSONModel.h"
@interface ProductModel : JSONModel
@property (nonatomic,strong)NSString
@property (nonatomic,strong)NSString
@property (nonatomic,strong)NSString
// ProductModel.m
// JSONModel
//
// Created by 张国锋 on 15/7/20.
// Copyright (c) 2015年 张国锋. All rights reserved.
//
#import "ProductModel.h"
@implementation ProductModel
+(JSONKeyMapper *)keyMapper{
return [[JSONKeyMapper alloc] initWithDictionary:@{@"id":@"id1",@"sss":@"xxxxx"}];
}
@end
// test1Model.h
// JSONModel
//
// Created by 张国锋 on 15/7/20.
// Copyright (c) 2015年 张国锋. All rights reserved.
//
#import "JSONModel.h"
@interface test2Model : JSONModel
@property (nonatomic,strong)NSString
@property (nonatomic,strong)NSString
@property (nonatomic,strong)NSString
@end
@interface test1Model : JSONModel
@property (nonatomic,strong)NSString
@property (nonatomic,strong)NSString
@property (nonatomic,strong)NSArray
@end
// test1Model.m
// JSONModel
//
// Created by 张国锋 on 15/7/20.
// Copyright (c) 2015年 张国锋. All rights reserved.
//
#import "test1Model.h"
@implementation test2Model
+(JSONKeyMapper *)keyMapper{
return [[JSONKeyMapper alloc] initWithDictionary:@{@"id":@"id1"}];
}
@implementation test1Model
// ViewController.h
// JSONModel
//
// Created by 张国锋 on 15/7/20.
// Copyright (c) 2015年 张国锋. All rights reserved.
//
#import
@interface ViewController : UIViewController
//
// ViewController.m
// JSONModel
//
// Created by 张国锋 on 15/7/20.
// Copyright (c) 2015年 张国锋. All rights reserved.
//
#import "ViewController.h"
#import "test1Model.h"
@interface ViewController ()
@implementation ViewController
(void)viewDidLoad {
[super viewDidLoad];
NSDictionary *dic=[[NSDictionary alloc]init];
test1Model *model=[[test1Model alloc]initWithDictionary:dic error:nil];
/*
@property (nonatomic,strong)NSString
@property (nonatomic,strong)NSString
@property (nonatomic,strong)NSArray
*/
// Do any additional setup after loading the view, typically from a nib.
}
(void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
手机扫一扫
移动阅读更方便
你可能感兴趣的文章