NSMutableArray *wholeJsonArray = [LoginResult objectForKey:@"Response"];
//NSMutableArray *values=[NSMutableArray arrayWithArray:[LoginResult allValues]];
NSMutableArray *statenameArray=[LoginResult objectForKey:@"Response"];
for(NSDictionary *countname in wholeJsonArray)
{
NSString *cName = [NSString stringWithFormat:@"%@",[countname objectForKey:@"country_name"]];
[countryArray addObject:cName];
}
for(NSDictionary *cid in wholeJsonArray)
{
NSNumber *number = [cid objectForKey:@"country_id"];
[idcountry addObject:number];
}
for(NSDictionary *statename in statenameArray)
{
NSString *sName=[NSString stringWithFormat:@"%@",[statename objectForKey:@"state_name"]];
[stateArray addObject:sName];
}
我写了上面的代码。
国家名称在表格视图中正确显示。状态名称响应也会显示,但显示的行数为空值,其他行值正确。那么我应该怎么做才能从几行中删除空值。
提前致谢。