Den aktuellen Standort des Benutzers ermitteln iOS 8.0

Ich versuche, mithilfe von MapKit und CoreLocation den aktuellen Standort der Benutzer zu ermitteln. Ich bin wirklich neu in Objective-C. Was meine Recherchen betrifft, unterscheidet sich die Implementierung geringfügig von älteren iOS-Versionen bis iOS 8.0. Ich habe alles richtig verfolgt. Trotzdem wird der aktuelle Standort angezeigt. Mein eigentliches Ziel ist es, die Position des Benutzers während der Laufzeit auf dem MapKit festzulegen, wenn der Benutzer die Position im Textfeld angibt.

filename.h
#import <UIKit/UIKit.h>
#import <MapKit/MapKit.h>
@interface LocationSelectionViewController : UIViewController <CLLocationManagerDelegate>
@property (weak, nonatomic) IBOutlet UITextField *insertLocation;
@property (strong, nonatomic) IBOutlet MKMapView *serviceLocation;
- (IBAction)next:(id)sender;

@end

#import "LocationSelectionViewController.h"
#import <CoreLocation/CoreLocation.h>

@interface LocationSelectionViewController () <CLLocationManagerDelegate>

@end

@implementation LocationSelectionViewController
CLLocationManager *locationManager;
@synthesize serviceLocation;

- (void)viewDidLoad {
    [super viewDidLoad];
    locationManager = [[CLLocationManager alloc] init];
    locationManager.delegate = self;
    [locationManager requestAlwaysAuthorization];
    [locationManager startUpdatingLocation];
    // Do any additional setup after loading the view.
    self.serviceLocation = [[MKMapView alloc] initWithFrame:self.view.bounds];
    self.serviceLocation.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
    [self.view addSubview:self.serviceLocation];
    [self.serviceLocation.delegate self];
    //[self.serviceLocation setShowsUserLocation:YES];
}

/*- (void)mapView:(MKMapView *)mapView didUpdateUserLocation:(MKUserLocation *)userLocation{
    CLLocationCoordinate2D loc=[userLocation coordinate];
    MKCoordinateRegion region = MKCoordinateRegionMakeWithDistance(loc, 100, 100);
    [self.serviceLocation setRegion:region animated:YES];
}*/

-(void) locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray<CLLocation *> *)locations{
    [locationManager requestAlwaysAuthorization];
    [locationManager startUpdatingLocation];

}
-(void) locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status{
    if(status == kCLAuthorizationStatusAuthorizedAlways || status == kCLAuthorizationStatusAuthorizedWhenInUse){
        self.serviceLocation.showsUserLocation = YES;
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)next:(id)sender {
}
@end

Wie im Bild habe ich die beiden Eigenschaften gemäß der iOS 8-Anforderung hinzugefügt.

Kann mir jemand bei der Archivierung raten:

den aktuellen Standort des Benutzers abrufen.den Ort aus dem Textfeld holen und während der Laufzeit auf dem MapKip fixieren.

Antworten auf die Frage(2)

Ihre Antwort auf die Frage