NSDictionary* result = [NSDictionary dictionaryWithContentsOfJSONURLString:url]; json
NSArray *peopleListFromJson = [result valueForKeyPath:@"data.list"]; 數組
注意使用的是data。list 前面的節點是data 而後後面是list ,這樣的狀況就會爆異常。爲了保證正確你也能夠 url
if ( ![peopleListFromJson isKindOfClass:[NSArray class]] && peopleListFromJson!=nil) { spa
peopleListFromJson =[NSArray arrayWithObject:peopleListFromJson]; 字符串
} it
檢測如下,在個人代碼裏 不檢測也是正確的。就是個人json格式和別人不一樣形成的 io