iOS 8 Mapview Current Location not fire

后端 未结 3 2068
你的背包
你的背包 2021-01-05 18:45

MKMapview current user location not fire in iOS-8,previous iOS-7 & iOS-6 are working fine.

     self.         


        
3条回答
  •  忘掉有多难
    2021-01-05 19:10

    In iOS 8 Mapview Current Location fire using

    You can set in your .plist file

    NSLocationWhenInUseUsageDescription
    Your app name Or Other string
    NSLocationAlwaysUsageDescription
    Your app name Or Other string
    

    And your code side you just implement this

    CLLocationManager * locationmanager = [CLLocationManager new];

    locationmanager.delegate = self;
    locationmanager.distanceFilter = kCLDistanceFilterNone;
    locationmanager.desiredAccuracy = kCLLocationAccuracyBest;
    [locationmanager startUpdatingLocation];    
    [locationmanager requestAlwaysAuthorization];
    

    -(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations {

    location = [locations objectAtIndex:0];
    [locationmanager stopUpdatingLocation];
    

    }

    I am using this my app get perfect current location.

提交回复
热议问题