简体   繁体   English

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

[英]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.

相关问题 我不知道如何在iOS 6中进行纵向和颠倒 - I don't know how to do Portrait and Upside down in iOS 6 我不知道如何在iPhone上保存用户的登录信息 - I don't know how to save Login Information of user on iPhone 显然我不知道如何写一个二传手 - Apparently I don't know how to write a setter 如何停止我不知道的NSTimer是否已发布 - How to stop an NSTimer that I don't know is released or not 我不了解并且不知道如何解决的ImagePicker IOS错误 - ImagePicker IOS errors i don't understand and don't know how to fix CLLocationManager distanceFilter如何工作? 您是否不需要更新才能知道手机在哪里? - How does CLLocationManager distanceFilter work? Don't you need an update to know where the phone is? 不知道如何处理大型数据库 - Don't know how to handle large database 我不知道如何在iPhone中使用md5密码或如何启动 - I don't know how to md5 my password in iPhone ,or how to start 简单游戏的逻辑问题,我碰壁了,不知道该如何克服……SOS! - Problem with a simple game's logic, I have hit a wall, and don't know how to get over it…SOS! 可变数组的二维NSMutableArray,但不知道我需要多少 - Two-dimensional NSMutableArray of mutable arrays, but don't know how many I'll need
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM