-
Notifications
You must be signed in to change notification settings - Fork 920
Open
Labels
Description
我有一个值为数组类型的json数据,例如:{"array":[1,2,3,4,5,6,7,8,9]} ,json数组中为 Number 类型,我想转换为 NSString 类型;
Model.h 声明
@property (nonatomic, copy) NSArray<NSString *> *array;
.m 实现方法:
+(nullable NSDictionary<NSString *, id> *)modelContainerPropertyGenericClass { return @{@"array" : [NSString class]}; }
但是转换后得到的 self.array 一直为一个空数组,不写 modelContainerPropertyGenericClass
方法或者类型制定为 {@"array" : [NSNumber class]}
可以正常获取数据,但不是想要的类型。
期待回复,谢谢!