SQLLite db から 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;
どんな助けでも大歓迎です。