objective-c - 定位不回调代理方法
阿神
阿神 2017-05-02 09:24:24
0
0
321

// 判断定位操作是否被允许

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];
}

**

回调方法(iPhone4s,5, 不会回调该方法,iphone5s 及其以上就可以,系统都是 ios9.2,xcode7.2模拟器测试)跪求大神解答!!!!

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

阿神
阿神

闭关修行中......

全員に返信(0)
人気のチュートリアル
詳細>
最新のダウンロード
詳細>
ウェブエフェクト
公式サイト
サイト素材
フロントエンドテンプレート
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!