有什么好的方法可以知道 CLLocationManager 的 startMonitoringForRegion 何时完成?
Is there any good way to know when CLLocationManager's startMonitoringForRegion has completed?
来自CLLocationManager.h:
/*
* startMonitoringForRegion:
*
* Discussion:
* Start monitoring the specified region.
*
* If a region of the same type with the same identifier is already being monitored for this application,
* it will be removed from monitoring. For circular regions, the region monitoring service will prioritize
* regions by their size, favoring smaller regions over larger regions.
*
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
*/
- (void)startMonitoringForRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_TBD,__IPHONE_5_0);
有什么好的方法可以知道这个异步调用何时完成?一旦我知道某个区域开始了区域监控,我就会尝试执行另一个操作,但看起来这可能需要 >1s 到 >20s 的任何时间。
当然可以。在 CLLocationManagerDelegate
你会发现 - locationManager:didStartMonitoringForRegion:
。 here 您将找到完整的委托说明。
来自CLLocationManager.h:
/*
* startMonitoringForRegion:
*
* Discussion:
* Start monitoring the specified region.
*
* If a region of the same type with the same identifier is already being monitored for this application,
* it will be removed from monitoring. For circular regions, the region monitoring service will prioritize
* regions by their size, favoring smaller regions over larger regions.
*
* This is done asynchronously and may not be immediately reflected in monitoredRegions.
*/
- (void)startMonitoringForRegion:(CLRegion *)region __OSX_AVAILABLE_STARTING(__MAC_TBD,__IPHONE_5_0);
有什么好的方法可以知道这个异步调用何时完成?一旦我知道某个区域开始了区域监控,我就会尝试执行另一个操作,但看起来这可能需要 >1s 到 >20s 的任何时间。
当然可以。在 CLLocationManagerDelegate
你会发现 - locationManager:didStartMonitoringForRegion:
。 here 您将找到完整的委托说明。