I'l想知道GPS位置/地區監測概括+如何開啓/關閉對GPS信號(圖標)在背景[iOS的]
A)如果可能的話完全關閉GPS的使用當應用程序處於後臺模式並終止它時(長按「主頁按鈕」,點擊相應任務的「X」),即使「區域監控」處於活動狀態且App中有相應的活動標誌.plst。
另外我想回顧一下如何監視設備位置;我認爲有三種方式: - [locationManager startUpdatingLocation] - [locationManager startMonitoringSignificantLocationChanges]; - [locationManager startMonitoringForRegion:region desiredAccuracy:accuracy]; B)我不明白他們「可以」/「不可以」/「必須」在同一時間運行。例如:startUpdatingLocation和startMonitoringSignificantLocationChanges是互斥的,沒關係,但startMonitoringForRegion怎麼樣?
C)我可以只使用startMonitoringForRegion而不使用startMonitoringSignificantLocationChanges嗎? D)如果我在同一時間同時使用兩種通知,我可以在進入/退出監控區域時收到兩個通知嗎?我怎樣才能避免它? 我這種情況下,我認爲應該實現這樣的事情:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
BOOL crossedBoundary = [self checkIfNewLocationHasCrossedMyMonitoredRegionBoundary:newLocation ];
if (crossedBoundary) NSLog(@"Crossed the boundary");
}
和
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { NSLog(@"Crossed the boundary"); }
E)我如何關閉/開啓startMonitoringForRegion而應用程序是在後臺?
非常感謝。 我是從 「區域」 和 「麪包屑」 蘋果例如 https://developer.apple.com/library/ios/#samplecode/Breadcrumb/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010048-Intro-DontLinkElementID_2
https://developer.apple.com/library/ios/#samplecode/Regions/Introduction/Intro.html
部分...我認爲這隻會停止正常的本地化。 – 2012-02-16 12:09:50