[ios] MapKitAnnotation zu ViewController

Heinzi1991

Erfahrenes Mitglied
Hallo liebe Community

Ich hab ein Problem und ich weiß nicht wie ich es lösen kann.

Also von Anfang an: ich habe eine plist mit Orten (also title, latitude und longitude variablen) die werden mit einer fast enumination ausgelesen und auf die Karte "gepint". Wenn man den Pin anklickt erscheint ein kleines Feld mit dem Titel und dem Info - Button.

Nun möchte ich gerne wenn man den Info - Button drückt, das man auf einen View Controller kommt, funktioniert ja auch schon, nur will ich das der Titel vom Pin auf der Title von meinem View Controller ist.

Ich hoffe ich habe mich einigermaßen klar ausgedrückt und mir kann jemand helfen.
 
hier mein code für die Erstellung der annotations

C++:
-(NSMutableArray *)createAnnotations
{
    NSMutableArray *annotations = [NSMutableArray new];
   
    //Read location details from plist
    NSString *path = [[NSBundle mainBundle] pathForResource:@"skatepark" ofType:@"plist"];
    NSArray *locations = [NSArray arrayWithContentsOfFile:path];
   
   
    for (NSDictionary *row in locations)
    {
        NSNumber *latitude = [row objectForKey:@"latitude"];
        NSNumber *longitude = [row objectForKey:@"longitude"];
        NSString *title = [row objectForKey:@"title"];
       
       
        //Create coordinates from the latitude and longitude values
        CLLocationCoordinate2D coord;
       
        coord.latitude = latitude.doubleValue;
        coord.longitude = longitude.doubleValue;
       
        MapViewAnnotation *annotation = [[MapViewAnnotation alloc] initWithTitle:title AndCoordinate:coord];
       
        [annotations addObject:annotation];
       
    }

  return annotations
}
 

Neue Beiträge

Zurück