Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 693 Bytes

README.md

File metadata and controls

31 lines (20 loc) · 693 Bytes

使用

基本的Model 和 JSON相互转换

    NSString *girlFriend = @"白菜";
    id parmenters = @{
                      @"girlFriend":girlFriend,
                      @"age":@22.1,
                      @"name":@"Lastdays",
                      @"time":@"2016-03-18 5:55:49 +0000"
                      };
    
    
    Model *model = [Model LYModelWithJSON:parmenters];
    NSLog(@"%@",model.girlFriend);
    NSLog(@"%@",model.name);
    NSLog(@"%@",model.age);
    NSLog(@"%@",model.time);

    
    NSLog(@"========================================");
    
    NSDictionary *jsonObject= [model LYModelToJson];
    NSLog(@"%@",jsonObject);

欢迎指出问题