Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/13.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
如何在iOS中解析JSON空键值?_Ios_Json - Fatal编程技术网

如何在iOS中解析JSON空键值?

如何在iOS中解析JSON空键值?,ios,json,Ios,Json,我是iOS开发的新手,我在我的web服务中制作了一个JSON数据解析的应用程序,我制作了一个字典和它的密钥,如 NSDictionary *dict = [self.dataArray objectAtIndex:indexPath.section]; 我的钥匙就像 NSString *content=[dict valueForKey:@"post_content"]; cell.descripLabel.text=content; 在我的web服务中,我的“post_内容”:false,

我是iOS开发的新手,我在我的web服务中制作了一个JSON数据解析的应用程序,我制作了一个字典和它的密钥,如

NSDictionary *dict = [self.dataArray objectAtIndex:indexPath.section];
我的钥匙就像

NSString *content=[dict valueForKey:@"post_content"];
cell.descripLabel.text=content;
在我的web服务中,我的“post_内容”:false,然后在

cell.descripLabel.text=content;

我如何解决它????

从您对其他问题的回答来看,您的JSON实际上返回的是布尔值,而不是空值,请尝试以下

id content=[dict valueForKey:@"post_content"];
if([content isKindOfClass:[NSString class]]) {
    cell.descripLabel.text = content;    
} else {
    cell.descripLabel.text =  @"";
}
@rmaddy eroor类似于“[\uu\NSCFBoolean length]:发送到实例的无法识别的选择器”