UISearchDisplayController UISearchBar(4)
{
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellName];
}
if([tableViewisEqual:self.searchController.searchResultsTableView]){
cell.textLabel.text = [self.searchDataobjectAtIndex:indexPath.row];
}else{
NSDictionary *dict = [self.dataListobjectAtIndex:[indexPath section]];
NSArray *shengfen = [dictobjectForKey:@"Citys"];
NSDictionary *citys = [shengfenobjectAtIndex:indexPath.row];
NSString *Name = [citysobjectForKey:@"C_Name"];
cell.textLabel.text = Name;
//[self.allCitys addObject:Name];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
if([tableViewisEqual:self.searchController.searchResultsTableView]){
self.cityName = [self.searchDataobjectAtIndex:indexPath.row];
((AppDelegate *)[[UIApplicationsharedApplication]delegate]).APPDelegateCityName = self.cityName;
}else{
self.cityName = [[[[self.dataListobjectAtIndex:indexPath.section] objectForKey:@"Citys"]objectAtIndex:indexPath.row] objectForKey:@"C_Name"];
((AppDelegate *)[[UIApplicationsharedApplication]delegate]).APPDelegateCityName = self.cityName;
}
[self.navigationControllerpopToRootViewControllerAnimated:YES];
}
相关新闻>>
- 发表评论
-
- 最新评论 更多>>