*我在 IOS5 上尝试此代码工作正常,但是当我在 IOS6 上尝试时什么都不做,我无法重现该问题......任何人都可以帮助我,这让我发疯...... *
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell =[tableView cellForRowAtIndexPath:indexPath];
if (cell.textLabel.text== @"Cairo") {
//Cairo
center.latitude=29.333983;
center.longitude=30.453069;
span.latitudeDelta=1.400686;
span.longitudeDelta= 2.705383;
region.center=center;
region.span=span;
[_mapView setRegion:region animated:NO];
}
else if(cell.textLabel.text== @"Alexandria")
{
// Alexandria
center.latitude=31.200092;
center.longitude=29.918739;
span.latitudeDelta=0.324794;
span.longitudeDelta=0.676346;
region.center=center;
region.span=span;
[_mapView setRegion:region animated:NO];
}
}