我不知道如何使用 calloutAccessoryControlTapped:(UIControl *)control

发布于 2024-08-21 10:10:59 字数 428 浏览 3 评论 0原文

在我的项目中有两个类(mapViewcontroller 和 listViewcontroller),mapView 上有很多用户可以拉的引脚。如果他拉了一个,我必须保存引脚的数据并将其管理到另一类。 所以我的问题是我必须在以下方法中实现什么来保存图钉的标题和副标题并在其他类上使用它???

enter code here- (void) mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)annView calloutAccessoryControlTapped:(UIControl *)control {

NSLog(@"Pin gedrückt und gespeichert!", [ann查看描述]); }

抱歉我的英语不好,我希望你能帮助我?

问候

in my project are two classes (mapViewcontroller and listViewcontroller) and on the mapView are a lot of pins that the user can pull. 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]);
}

sorry about my bad english, i hope you can help me??

greetings

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喜爱纠缠 2024-08-28 10:10:59

好吧,您可以像这样获取标题和副标题:

NSString *pinTitle=view.annotation.title;
NSString *pinSubtitle=view.annotation.subtitle;

要将它们放入另一个视图控制器中的 NSMutableDictionary 或类似内容中,请使用有关在另一个视图控制器中共享/访问变量的线程中推荐的方法之一。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文