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.
精彩评论