search

Home  >  Q&A  >  body text

Targeting proxy method without callback - Stack Overflow

// Determine whether the positioning operation is allowed

if([CLLocationManager locationServicesEnabled]) {
    //定位初始化
    _locationManager=[[CLLocationManager alloc] init];
    _locationManager.delegate=self;
    _locationManager.desiredAccuracy=kCLLocationAccuracyBest;
    _locationManager.distanceFilter=10;
    if ([[UIDevice currentDevice].systemVersion intValue]>=8) {
        [_locationManager requestWhenInUseAuthorization];//使用程序其间允许访问位置数据(iOS8定位需要)
    }
    [_locationManager startUpdatingLocation];//开启定位
}else {
    //提示用户无法进行定位操作
    UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"提示" message:@"定位失败,请确认开启定位..." delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
    [alertView show];
}

**

Callback method (iPhone4s, 5, this method will not be called back, iPhone5s and above will do, the system is tested with ios9.2, xcode7.2 simulator) Please give me the answer!!!!

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

阿神阿神2835 days ago480

reply all(0)I'll reply

No reply
  • Cancelreply