iOS 第三方的使用

MJExtension

2019-03-20  本文已影响0人  风冰武
//1: 通过字典数组来创建一个模型数组
示例:
//模型类
@interface Student : NSObject
@property (nonatomic, copy) NSString *name;
@property (nonatomic, copy) NSString *age;
@property (nonatomic, copy) NSString *gender;
@end

NSArray *teamArray = @[@{@"name":@"JK",@"age":@"18",@"gender":@"male"},@{@"name":@"MK",@"age":@"20",@"gender":@"female"},@{@"name":@"John",@"age":@"31",@"gender":@"male"}];
//通过字典数组来创建一个模型数组
NSArray<Student *> *studentArray = [Student mj_objectArrayWithKeyValuesArray:teamArray];
    

上一篇下一篇

猜你喜欢

热点阅读