我想在我正在显示的地图上单击DetailDisclosure时切换视图。我当前的代码如下:MKAnnotationView在DetailDesclosure按钮被点击时推送到视图控制器
- (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?
我知道我有点偏离目标。也许只是在正确的方向踢一脚也许会有所帮助。谢谢!
感谢Rob,我是否需要使用故事板才能拥有Segue? – Brandon 2013-02-11 04:56:47
k我看着它。一如既往 - YOU ROCK – Brandon 2013-02-11 04:58:30
那么,如何访问新视图上的字段?我正试图在我的应用中完成同样的事情。 – 2014-02-19 22:12:35