Xcode用户位置在新版本(Objective-C)中不再工作



我有一个按钮移动到用户的位置。我在viewcontroller .h中声明它,然后将以下代码添加到ViewController.m中:

- (IBAction)userLocation:(id)sender {   
    [_mapView setCenterCoordinate:_mapView.userLocation.location.coordinate animated:YES];
}

一直指向(0,0)坐标。在更新的Xcode版本中,我是否需要添加一些内容才能使其再次工作?

从iOS8开始,你必须为位置服务设置一个使用描述:https://stackoverflow.com/a/24718342/4948826

最新更新