MKMapView delegate::regionDidChangeAnimated wird nicht aufgerufen...

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • MKMapView delegate::regionDidChangeAnimated wird nicht aufgerufen...

    Hey,

    ich habe in meinem storyboard ein MKMapView zum Controller hinzugefügt, das ganze noch mit nem IBOutlet verbunden und auch das Delegate vom MKMapView auf meinen Controller gesetzt.

    Problem:
    Ich kann noch so wild im Simulator auf der Map rumscrollen, aber im Titel besagte Methode wird nicht aufgerufen..

    Code des Controller:

    Quellcode

    1. //
    2. // PMFirstViewController.m
    3. // PicMap
    4. //
    5. // Created by Daniel Bocksteger on 09.05.13.
    6. // Copyright (c) 2013 Bocksteger. All rights reserved.
    7. //
    8. #import "PMFirstViewController.h"
    9. @interface PMFirstViewController ()
    10. @end
    11. @implementation PMFirstViewController
    12. - (void)viewDidLoad
    13. {
    14. [super viewDidLoad];
    15. // Do any additional setup after loading the view, typically from a nib.
    16. }
    17. - (void)didReceiveMemoryWarning
    18. {
    19. [super didReceiveMemoryWarning];
    20. // Dispose of any resources that can be recreated.
    21. }
    22. - (void)map:(MKMapView *)map regionDidChangeAnimated:(BOOL)animated
    23. {
    24. [self printCoordinatesForNewRegion];
    25. }
    26. - (void)printCoordinatesForNewRegion
    27. {
    28. //To calculate the search bounds...
    29. //First we need to calculate the corners of the map so we get the points
    30. CGPoint nePoint = CGPointMake(map.bounds.origin.x + map.bounds.size.width, map.bounds.origin.y);
    31. CGPoint swPoint = CGPointMake((map.bounds.origin.x), (map.bounds.origin.y + map.bounds.size.height));
    32. //Then transform those point into lat,lng values
    33. CLLocationCoordinate2D neCoord;
    34. neCoord = [map convertPoint:nePoint toCoordinateFromView:map];
    35. CLLocationCoordinate2D swCoord;
    36. swCoord = [map convertPoint:swPoint toCoordinateFromView:map];
    37. NSLog(@"-- NE --");
    38. NSLog(@"Latitude:%f", neCoord.latitude);
    39. NSLog(@"Longitude:%f", neCoord.longitude);
    40. NSLog(@"-- SW --");
    41. NSLog(@"Latitude:%f", swCoord.latitude);
    42. NSLog(@"Longitude:%f", swCoord.longitude);
    43. }
    44. @end
    Alles anzeigen


    Im Anhang mal das Projekt....

    Ich hoffe jemand kennt das Problem oder kann mir helfen.

    osxentwicklerforum.de/index.ph…1b0059d207960f3c9edb88ea6
    Man kann alles schaffen. Man muss es nur wollen ;)
    www.regetskcob.github.io