當(dāng)我在顯示的地圖上單擊DetailDisclosure時,我想切換視圖。我當(dāng)前的代碼如下:- (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數(shù)組中提取細(xì)節(jié)。我正在拉這樣的數(shù)據(jù)來生成地圖: 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?我知道我有點偏離目標(biāo)了。也許朝正確的方向踢會有所幫助。謝謝!
- 1 回答
- 0 關(guān)注
- 494 瀏覽
添加回答
舉報
0/150
提交
取消