mapAddressArray = [[NSMutableArray alloc] init];//记录地址
mapDealerNameArray = [[NSMutableArray alloc] init];//记录名称
mapDimensionArray = [[NSMutableArray alloc] init];//记录经度
mapLongitudeArray = [[NSMutableArray alloc] init];//记录纬度
NSString *URIString=[NSString stringWithFormat:@"http://xxx/app/getDealers.action?dealerType=%d&provinceId=%@&cityId=%@",num,num2,num3];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@",URIString]];
// NSLog(@"url::%@",url);
NSError *error = nil;
NSString *jsonString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:&error];
// NSLog(@"%@",jsonString);
[mapAddressArray removeAllObjects];
[mapDealerNameArray removeAllObjects];
[mapDimensionArray removeAllObjects];
[mapLongitudeArray removeAllObjects];
SBJsonParser *parser = [[SBJsonParser alloc] init];
id jsonObject = [parser objectWithString:jsonString error:&error];
if ([jsonObject isKindOfClass:[NSDictionary class]]) // treat as a dictionary, or reassign to a dictionary ivar
{
NSMutableArray *tempArray = [jsonObject objectForKey:@"dealers"];
for(NSMutableDictionary *shengInfoName in tempArray) {
[mapAddressArray addObject:[shengInfoName objectForKey: @"address"]];
[mapDealerNameArray addObject:[shengInfoName objectForKey: @"dealerName"]];
[mapDimensionArray addObject:[shengInfoName objectForKey: @"dealerDimension"]];
[mapLongitudeArray addObject:[shengInfoName objectForKey: @"dealerLongitude"]];
// NSLog(@"ss::%d",tempArray.count);
}