Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如何使用Mantle定制NSdictionary?_Objective C_Json_Nsdictionary_Github Mantle - Fatal编程技术网

Objective c 如何使用Mantle定制NSdictionary?

Objective c 如何使用Mantle定制NSdictionary?,objective-c,json,nsdictionary,github-mantle,Objective C,Json,Nsdictionary,Github Mantle,我有以下json字符串: {"suit_id": 2427; "suits": "http://img.prettyyes.com/1137-4930-1446175512.jpeg;http://img.prettyyes.com/1137-7665-1446175512.jpeg;http://img.prettyyes.com/1137-4783-1446175512.jpeg"} 因此,当使用mantle解析带有以下文件的json字符串时 testModel.h @interface

我有以下json字符串:

{"suit_id": 2427;
"suits": "http://img.prettyyes.com/1137-4930-1446175512.jpeg;http://img.prettyyes.com/1137-7665-1446175512.jpeg;http://img.prettyyes.com/1137-4783-1446175512.jpeg"}
因此,当使用mantle解析带有以下文件的json字符串时

testModel.h

@interface testModel : MTLModel <MTLJSONSerializing>
@property (nonatomic, strong) NSString *suit_id;
@property (nonatomic, strong) NSString *suits;
@end
@interface testModel : MTLModel <MTLJSONSerializing>
@property (nonatomic, strong) NSString *suit_id;
@property (nonatomic, strong) NSArray *suits;
@end
我多么希望将西服从字符串转换为具有多个URL的NSArray,因此我做了以下工作:

testModel.h

@interface testModel : MTLModel <MTLJSONSerializing>
@property (nonatomic, strong) NSString *suit_id;
@property (nonatomic, strong) NSString *suits;
@end
@interface testModel : MTLModel <MTLJSONSerializing>
@property (nonatomic, strong) NSString *suit_id;
@property (nonatomic, strong) NSArray *suits;
@end

但它不起作用。结果是零。当我重写错误的函数时?

suites
返回
NSValueTransformer
的方法应称为
suitesjsontransformer
,而不是
suitesjsontransform


方法名称的格式为
JSONTransformer

suites
返回
NSValueTransformer
的方法应称为
suitesjsontransformer
,而不是
suitesjsontransform

方法名称的格式为
JSONTransformer