私には2つの見方があります。1つ目は、MKMapView
いくつかの注釈付きです。プッシュをクリックするとUIButton
、スタックの2番目のビューがプッシュされます。これにはUITableView
、マップ注釈に対応する注釈のリストがあります。したがって、削除ボタンをクリックしたときにMKMapView
、別のビューにあるmyを呼び出すと、注釈を削除できます。私MKMapView
は、現在のクラスだけでなく、アプリデリゲートでも宣言されています。私は以下を使おうとしていますが、機能していません:
RideAppDelegate *appDelegate = (RideAppDelegate *)[[UIApplication sharedApplication] delegate];
Annotation *ano;
CLLocationCoordinate2D anoPoint;
anoPoint.latitude = [[eventToDelete valueForKey:@"latitude"] doubleValue];
anoPoint.longitude = [[eventToDelete valueForKey:@"longitude"] doubleValue];
ano = [[[Annotation alloc] init] autorelease];
ano.coordinate = anoPoint;
[appDelegate.ridesMap removeAnnotation: ano];
[appDelegate release];
MKMapView
他のビューに誤ってアクセスしようとしている必要がありますか?