UIImagePickerController из Mapkit Аннотация?

У меня есть проект, в котором я загружаю пользовательские аннотации из базы данных SQLLite в MapKit и вызываю их, отправляя электронное письмо. То, чего я хотел бы добиться, - это предоставить пользователю возможность выбора изображения (камера или рулон камеры), нажав кнопку "Инфо" во время вызова аннотации.

Может кто-нибудь помочь с этим?

Это мой код аннотации.

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{

NSLog(@"show me");

    if ([annotation isKindOfClass:[MKUserLocation class]])
{
    return nil;
}
else if ([annotation isKindOfClass:[MKPointAnnotation class]]) 
{
    static NSString * const identifier = @"MyCustomAnnotation";

    MKAnnotationView* annotationView = [mapView dequeueReusableAnnotationViewWithIdentifier:identifier];

    if (annotationView)
    {
        annotationView.annotation = annotation;
    }
    else
    {
        annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation
                                                      reuseIdentifier:identifier];
    }

    annotationView.canShowCallout = YES;
    annotationView.image = [UIImage imageNamed:@"mycusomimage.png"];
    UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];

     [infoButton addTarget:self action:@selector(openMail:) forControlEvents:UIControlEventTouchUpInside];


    annotationView.rightCalloutAccessoryView = infoButton;

     return annotationView;
}
return nil;

Любая помощь будет принята с благодарностью.

0 ответов

Другие вопросы по тегам