I have a set of annotations on my map, each of which have a right callout button. When that button is called it opens a pop up window, which I can create easily, but I cannot figure out how to populate it with traits such as the title within the popup. Here is my code I have
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
{
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:.2];
[_infoview setAlpha:1];
[UIView commitAnimations];
_infoview.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.001, 0.001);
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDelay:0];
[UIView setAnimationDuration:0.3/1.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(bounceInfoAnimation)];
[self.view addSubview:_popView];
_infoview.transform = CGAffineTransformScale(CGAffineTransformIdentity, 1.1, 1.1);
[UIView commitAnimations];
lblTitle.text = pawpost.title;
}
Now my question is how can I get the title to populate in the window. Do I need to try to do it all through this function? A different function? Or do I need to create a completely new file to write it in?
I am also trying to separately have a button that calls the phone number of that chosen location. This is the code I have but the "pawpost.phone" is not corresponding.
-(IBAction)callPhone:(id)sender {
NSString* yourActualNumber = [NSString stringWithFormat:@"tel:%@",pawpost.phone];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:yourActualNumber]];
NSLog(@"phone");
}