为了账号安全,请及时绑定邮箱和手机立即绑定

MKAnnotationView单击“ DetailDesclosure”按钮时推送到视图控制器

MKAnnotationView单击“ DetailDesclosure”按钮时推送到视图控制器

牛魔王的故事 2019-10-12 13:36:07
当我在显示的地图上单击DetailDisclosure时,我想切换视图。我当前的代码如下:- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control{    DetailViewController *detailViewController = [[DetailViewController alloc]     initWithNibName:@"DetailViewController" bundle:nil];    detailViewController.title = dictionary[@"placeLatitude"]    [self.navigationController pushViewController:detailViewController animated:YES];}我可以使用它推送到视图控制器,但是我还没有弄清楚如何强制它从用于生成地图的JSON数组中提取细节。我正在拉这样的数据来生成地图: for (NSDictionary *dictionary in array) {    // retrieve latitude and longitude from the dictionary entry    location.latitude = [dictionary[@"placeLatitude"] doubleValue];    location.longitude = [dictionary[@"placeLongitude"] doubleValue];   //CAN I LOAD THE TITLE/ID OF THE LOCATION HERE?我知道我有点偏离目标了。也许朝正确的方向踢会有所帮助。谢谢!
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 428 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信