I would like to switch views when a DetailDisclosure is clicked on a map I am displaying. My current code is as below:
- (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];
}
I can push to the view controller with this, but I haven't figured out how to force it to pull details from the JSON array used to generate the map in the first place. I am pulling data like this to generate the map:
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?
I know I'm a bit off target. Maybe just a kick in the right direction might help. Thank you!