大家好 今天给大家推荐一个第三方库 MJExtension(也许又不少人知道了的 就是献个丑哈 )
GitHub - CoderMJLee/MJExtension: A fast 这是哪个链接 转换速度快、使用简单方便的字典转模型框架
MJExtension是一套字典和模型之间互相转换的超轻量级框架
JSON-->Model、Core Data Model
JSONString-->Model、Core Data Model
Model、Core Data Model-->JSON
JSON Array-->Model Array、Core Data Model Array
JSONString-->Model Array、Core Data Model Array
Model Array、Core Data Model Array-->JSON Array
Coding all properties of model in one line code.
只需要一行代码,就能实现模型的所有属性进行Coding(归档和解档)
NSString -> NSDate, nil -> @""
pod'MJExtension'
Drag all source files under floderMJExtensionto your project.【将MJExtension文件夹中的所有源代码拽入项目中】
Import the main header file:#import "MJExtension.h"【导入主头文件:#import "MJExtension.h"】
MJExtension.h
MJConst.h MJConst.m
MJFoundation.h MJFoundation.m
MJProperty.h MJProperty.m
MJType.h MJType.m
NSObject+MJCoding.h NSObject+MJCoding.m
NSObject+MJProperty.h NSObject+MJProperty.m
NSObject+MJKeyValue.h NSObject+MJKeyValue.m