2013-09-24 2 views
1

iphone 응용 프로그램은 iphone & iPad 용으로 개발되었습니다.monitoringDidFailForRegion은 ipad에서만 호출합니다.

해당 응용 프로그램에서 위치 추적 기능을 통합했습니다.

다음은 구현 한 방법입니다.

 //start monitoring for region for checked in location 
    CLLocationCoordinate2D centerCoordinate = CLLocationCoordinate2DMake(latitude,longtitude); 
    regionalMonitor = [[CLRegion alloc] initCircularRegionWithCenter:centerCoordinate  radius:REGIONAL_MONITOR_RADIOUS identifier:@"checkedIn"]; 
    [locationManager startMonitoringForRegion:regionalMonitor]; 


- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region 
{ 
     NSLog(@"didEnterRegion"); 
} 
- (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region 
{ 
     NSLog(@"didExitRegion"); 
} 
- (void)locationManager:(CLLocationManager *)manager monitoringDidFailForRegion:(CLRegion *)region withError:(NSError *)error 
{ 
    NSLog(@"Region monitoring failed with error: %@", [error localizedDescription]); 

} 

이 방법은 완벽하게 아이폰 응용 프로그램에서 작동합니다. 하지만 내가 ipad에서 그들을 실행하려고하면

monitoringDidFailForRegion 

메서드가 호출됩니다. 하지만 그것은 완벽하게 ipad 시뮬레이터에서 작동합니다.

특별한 이유가 있거나 장치 지향 버그입니까? 나는 그런

[locationManager startMonitoringForRegion:regionalMonitor]; 

을 언급하는 경우가 monitoringDidFailForRegion 방법이라고하지 않기 때문에

로그 메시지 - 지역 모니터링 오류로 인해 실패 : 작업을 완료 할 수 없습니다.

감사

답변

1

나는 지오 펜싱은 와이파이 아이 패드에서 지원, 또는 적어도 세 사람되지 않는다는 것을 확신합니다.

[locationManager isMonitoringAvailableForClass:CLRegion] 값을 인쇄 해보십시오. 그게 사실이라면 (1), 작동해야합니다. 그렇지 않으면 현재 장치에서 지원되지 않습니다.

+0

안녕하십니까, 감사합니다. 나는이 메소드 regionMonitoringAvailable을 가지고 체크했다. 거짓을 반환합니다. 하지만 나는이 일이 실제로 필요합니다. 이 문제에 대한 해결책은 무엇입니까 –

+0

@ Mr.G : 그렇지 않습니다. 3g/4g 안의 iPads에서 기능을 사용 중지하면됩니다. – Linuxios

+0

예, 동의합니다. 나는 ipad 2 wi-fi 버전 doent가 지역 모니터 기능을 가지고 있다는 멋진 기사를 발견했다. –

관련 문제