【发布时间】:2014-01-26 00:25:20
【问题描述】:
我正在尝试将我当前通过 Google Places API 加载到注释中的数据传递到我通过情节提要创建的详细视图控制器中。
单击每个注释上的详细信息披露后,我已正确加载详细信息视图控制器,但我现在正在尝试获取传递的数据。
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
// Assuming I call the MapPoint class here and set it to the current annotation
// then I'm able to call each property from the MapPoint class but wouldn't
// I have to set this in the prepareForSegue but that would be out of scope?
MapPoint *annView = view.annotation;
// annView.name
// annView.address
[self performSegueWithIdentifier:@"showBarDetails" sender:view];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([[segue identifier] isEqualToString:@"showBarDetails"])
{
BarDetailViewController *bdvc = [self.storyboard instantiateViewControllerWithIdentifier:@"showBarDetails"];
//This parts confusing me, not sure how I obtain the data
// from the above mapView delegation method?
// annView.name = bdvc.name;
bdvc = segue.destinationViewController;
}
}
【问题讨论】:
-
我很容易在不使用故事板和笔尖的情况下完成此任务。但我正在尝试学习如何使用纯故事板。
标签: ios iphone objective-c mapkit uistoryboardsegue