위치 앱을 만듭니다. 그러나 핵심 위치는 작동하지 않습니다. iPhone에서 다른 iPhone 응용 프로그램을 테스트했습니다.
Google 어스, 탐색 소프트웨어와 같습니다. 다른 응용 프로그램도 작동하지 않습니다.
위치가 업데이트되지 않는 이유는 무엇입니까?
왜 'locationManager : didUpdateToLocation : fromLocation :'메시지가 2 번만 호출 되었습니까?
iOS 6 CoreLocation이 작동하지 않습니다.
어쩌면 ... 내 iPhone이 고장 났습니까? 또는 iOS 6 CoreLocation 프레임 워크에 버그가 있습니까?
위치 서비스 -에 아이폰은
의 Info.plist
- 하는 ARMv7
- 가속도계
- 위치 서비스
- GPS
- 마이크
- 자력계 설정 값
코드 예 :
- (CLLocationManager *)setupLocationManager
{
if ([CLLocationManager locationServicesEnabled] && [CLLocationManager headingAvailable]) {
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation;
locationManager.distanceFilter = kCLDistanceFilterNone;
locationManager.headingFilter = kCLHeadingFilterNone;
[locationManager startUpdatingLocation];
[locationManager startUpdatingHeading];
return locationManager;
}
return nil;
}
- (CLLocationManager *)locationManager
{
switch([CLLocationManager authorizationStatus])
{
case kCLAuthorizationStatusAuthorized:
_deltaTimeLocationReceived = 0.0;
if (_locationManager == nil)
_locationManager = [self setupLocationManager];
return _locationManager;
case kCLAuthorizationStatusDenied:
case kCLAuthorizationStatusRestricted:
if (_locationManager)
_locationManager = nil;
return _locationManager;
case kCLAuthorizationStatusNotDetermined:
_deltaTimeLocationReceived = 0.0;
if (_locationManager == nil)
_locationManager = [self setupLocationManager];
return nil;
}
return nil;
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSLog(@"%@ %@", NSStringFromSelector(_cmd), newLocation.description);
if (self.locationManager) _locationSignal++;
}
- (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
NSLog(@"%@ %@", NSStringFromSelector(_cmd), error.description);
}
에서 보안 설정을 지우셨습니까? – Jessedc
예 위치 서비스 설정 - 켜짐. 감사. – booiljoung
설정 -> 일반 -> 재설정 -> 위치 및 개인 정보 재설정을 누릅니다. – Jessedc