开发者

I don't know how to work with calloutAccessoryControlTapped:(UIControl *)control

开发者 https://www.devze.com 2022-12-19 17:43 出处:网络
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

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 {

N开发者_运维问答SLog(@"Pin gedrückt und gespeichert!", [annView description]); }

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消