1

我想找到如果mapkit无法获取用户位置(无法在用户位置显示蓝色斑点)并显示警报然后再次重新定位位置。我不想使用corelocation.plz帮助我。

4

1 回答 1

0

您可以尝试使用被调用的委托方法来查看是否要求蓝点:


- (MKAnnotationView *) mapView: (MKMapView *)aMapView viewForAnnotation: (id )annotation 
{               
    if (annotation == aMapView.userLocation) 
    {
        return nil; // this might be the moment the location was first detected
    }
}

您可以假设仅在知道地图套件的位置后才要求蓝点。但是,我认为这不是一个好主意,因为这些东西可能很容易在 SDK 的下一个版本中中断。

我建议使用核心位置。从长远来看,它相对易于使用,并为您提供所有的灵活性和稳定性。

于 2009-11-09T07:09:43.057 回答