[__NSArray0 objectForKeyedSubscript:]: unrecognized selector sent to instance

1.报错:


[__NSArray0 objectForKeyedSubscript:]: unrecognized selector sent to instance_第1张图片
Snip20160217_2.png

2.验证错误:

XDLLog(@"%@---%@",responseObject,[responseObject class]);
[__NSArray0 objectForKeyedSubscript:]: unrecognized selector sent to instance_第2张图片
Snip20160217_3.png

3.解决方法:

//如果服务器返回的数据不是一个字典,直接返回(解决空评论导致的报错)
        if(![responseObject isKindOfClass:[NSDictionary class]])
        {
            self.commentTableView.mj_header.hidden = YES;
            [self.commentTableView.mj_footer endRefreshingWithNoMoreData];
            return;
        }

你可能感兴趣的:([__NSArray0 objectForKeyedSubscript:]: unrecognized selector sent to instance)