我正在使用 AFNetworking 获取 JSON 响应并基于它填充我的 UITableView。但是,我<a href='link'>
在一些 JSON 响应中得到了 HTML 标签。如何在填充我的表格视图单元格时删除它们并获得正确的格式?
下面是使用来自 JSON 响应的 AFNetworking 在 tableview 中重新加载数据的代码 -
NSURL *url = [NSURL URLWithString:@"http://xxxxx.com/api.php?req=all"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id responseObject) {
self.jobsArrayFromAFNetworking = [[responseObject objectForKey:@"all"]mutableCopy];
[spinner stopAnimating];
[self.tableView reloadData];
NSLog(@"JSON RESULT %@",responseObject);
}failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id responseObject){
NSLog(@"Request failed with error: %@, %@",error,error.userInfo);
}];
[operation start];
}