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:
Alles anzeigen
Im Anhang mal das Projekt....
Ich hoffe jemand kennt das Problem oder kann mir helfen.
osxentwicklerforum.de/index.php/Attachment/4444/
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
- //
- // PMFirstViewController.m
- // PicMap
- //
- // Created by Daniel Bocksteger on 09.05.13.
- // Copyright (c) 2013 Bocksteger. All rights reserved.
- //
- #import "PMFirstViewController.h"
- @interface PMFirstViewController ()
- @end
- @implementation PMFirstViewController
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- // Do any additional setup after loading the view, typically from a nib.
- }
- - (void)didReceiveMemoryWarning
- {
- [super didReceiveMemoryWarning];
- // Dispose of any resources that can be recreated.
- }
- - (void)map:(MKMapView *)map regionDidChangeAnimated:(BOOL)animated
- {
- [self printCoordinatesForNewRegion];
- }
- - (void)printCoordinatesForNewRegion
- {
- //To calculate the search bounds...
- //First we need to calculate the corners of the map so we get the points
- CGPoint nePoint = CGPointMake(map.bounds.origin.x + map.bounds.size.width, map.bounds.origin.y);
- CGPoint swPoint = CGPointMake((map.bounds.origin.x), (map.bounds.origin.y + map.bounds.size.height));
- //Then transform those point into lat,lng values
- CLLocationCoordinate2D neCoord;
- neCoord = [map convertPoint:nePoint toCoordinateFromView:map];
- CLLocationCoordinate2D swCoord;
- swCoord = [map convertPoint:swPoint toCoordinateFromView:map];
- NSLog(@"-- NE --");
- NSLog(@"Latitude:%f", neCoord.latitude);
- NSLog(@"Longitude:%f", neCoord.longitude);
- NSLog(@"-- SW --");
- NSLog(@"Latitude:%f", swCoord.latitude);
- NSLog(@"Longitude:%f", swCoord.longitude);
- }
- @end
Im Anhang mal das Projekt....
Ich hoffe jemand kennt das Problem oder kann mir helfen.
osxentwicklerforum.de/index.php/Attachment/4444/
Man kann alles schaffen. Man muss es nur wollen
www.regetskcob.github.io
www.regetskcob.github.io