[英]I don't know how to work with calloutAccessoryControlTapped:(UIControl *)control
in my project are two classes (mapViewcontroller and listViewcontroller) and on the mapView are a lot of pins that the user can pull. 在我的项目中,有两个类(mapViewcontroller和listViewcontroller),而mapView上有很多用户可以拉的销子。 If he pulled one i have to save the data of the pins and manage it to the other class.
如果他拉了一个,我必须保存引脚的数据并将其管理到另一类。 so my question what i have to implement in the following method to save the title and subtitle of the pin and use it on the other class???
所以我的问题是我必须在以下方法中实现什么才能保存图钉的标题和副标题并在其他类上使用它???
enter code here- (void) mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)annView calloutAccessoryControlTapped:(UIControl *)control {
NSLog(@"Pin gedrückt und gespeichert!", [annView description]); NSLog(@“ Pingedrücktund gespeichert!”,[annView描述]); }
}
sorry about my bad english, i hope you can help me?? 对我的英语不好对不起,我希望你能帮助我?
greetings 问候
Well, you can get the title and subtitle like this: 好吧,您可以像这样获得标题和副标题:
NSString *pinTitle=view.annotation.title;
NSString *pinSubtitle=view.annotation.subtitle;
To put them in a NSMutableDictionary
or similar in another viewcontroller, use one of the methods recommended in the threads about sharing/accessing variables in another viewcontroller. 要将它们放置在另一个视图控制器中的
NSMutableDictionary
或类似名称中,请使用线程中推荐的关于在另一个视图控制器中共享/访问变量的方法之一。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.