2
self.locationManager = [[[CLLocationManager alloc] init]autorelease];
self.locationManager.pausesLocationUpdatesAutomatically=NO;
[self.locationManager setDelegate:self];
if([[[UIDevice currentDevice ]systemVersion] floatValue]>=8.0)
{
if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[self.locationManager requestWhenInUseAuthorization];
}
}
[self.locationManager startUpdatingLocation];
代码从未调用didUpdate位置方法,而是失败,立即调用错误。 错误描述: 该操作无法完成。 (kCLErrorDomain错误0.) 但有些时候更新位置被调用(20次中有1次),试图重置网络和位置设置,但仍然无法正常工作。错误域= kCLErrorDomain代码= 0“(空)”
谢谢
并且您是否调用过[[localized localizedDe scription]'来获得错误的一些细节? – trojanfoe
@trojanfoe不,我检查 –
@trojanfoe该操作无法完成。 (kCLErrorDomain错误0.) –