问候, 我已经进入iOS只有1.5个月了,我希望我不要问一个已经在这里得到解答的问题。那就是:iPhone - 用UITableview didSelectRowAtIndexPath方法显示覆盖图
我的tableview是列出了一些持续时间每个属于包含坐标与时间戳覆盖:
for (NSUInteger i = 0; i < [dataset count]; i++)
{
crumbPath = [[CrumbPath alloc] initWithCenterCoordinate:mapView.userLocation.coordinate]; //crumbPath is my overlay
NSDictionary *route = [dataset objectAtIndex:i];
NSArray *points = [route objectForKey:@"Points"];
for (NSUInteger j = 0; j < [points count]; j++)
{
NSDictionary *point = [points objectAtIndex:j];
float latitude = (float)([[point objectForKey:@"Latitude"] doubleValue]/1000000);
float longitude = (float)([[point objectForKey:@"Longitude"] doubleValue]/1000000);
CLLocationCoordinate2D tempCoord = CLLocationCoordinate2DMake(latitude, longitude);
[crumbPath addCoordinate:tempCoord];
}
[mapView addOverlay:crumbPath];
[crumbPath release];
}
据我所知,我可以列出我的tableview持续时间,我想现在要做的就是用tableView:didSelectRowAtIndexPath方法来显示在tableview上点击持续时间的叠加层。现在,我的叠加层都显示在mapview上,我只想显示选中的一个。
在此先感谢!
阿里
感谢您的回复。我很快在didSelectRowAtIndex方法内使用数组发现了我的解决方案。 – 2011-04-05 10:13:46