Hi friends,
When I use mantle to parse JSON, because the returned data is an array, instead of a Dictionary directly, so I have to use " fromJSONArray".
- (RACSignal *)fetchCurrentDataForLocation:(CLLocationCoordinate2D)coordinate{
NSString *urlString = [NSString stringWithFormat:@"...a certain url"];
NSURL *url = [NSURL URLWithString:urlString];
return [[self fetchJSONFromURL:url] map:^(NSArray *json) {
return [MTLJSONAdapter modelOfClass:[CertainClass class] fromJSONArray:json error:nil];
}];
}I get error prompt as follows: "No known class method for selector 'modelOfClass: fromJSONArray:error: ".
Please help. thanks!
When I use mantle to parse JSON, because the returned data is an array, instead of a Dictionary directly, so I have to use " fromJSONArray".
- (RACSignal *)fetchCurrentDataForLocation:(CLLocationCoordinate2D)coordinate{
NSString *urlString = [NSString stringWithFormat:@"...a certain url"];
NSURL *url = [NSURL URLWithString:urlString];
return [[self fetchJSONFromURL:url] map:^(NSArray *json) {
return [MTLJSONAdapter modelOfClass:[CertainClass class] fromJSONArray:json error:nil];
}];
}I get error prompt as follows: "No known class method for selector 'modelOfClass: fromJSONArray:error: ".
Please help. thanks!
解决方案 »
- iphone ZBarSDK二维码扫描
- [新手求教] IMP与void*的使用有和区别?为何运行结果不一致?
- 如何禁止文本框弹出“copy|cut|select all”菜单
- 苹果的电脑和手机用的平台是不同的吗?
- NSProgress进度条重画问题
- 已经使用AMDeviceLookupApplications看到了未越狱Iphone中的应用bound_id,接下来怎么查看应用程序的数据呢?
- UITableView 设置BackGroundView ?
- xcode5.02 Security.framework库
- 关于横屏应用中插入个别竖屏view问题 求大神指点
- UICollectionView 水平显示问题
- iOS 如何调用ashx接口
- 如何修改分享到微信朋友圈的应用来源名称
+ (NSArray *)modelsOfClass:(Class)modelClass fromJSONArray:(NSArray *)JSONArray error:(NSError **)error;