我正在模拟器上测试区域监控.
[CLLocationManager regionMonitoringAvailable]和[CLLocationManager regionMonitoringEnabled]都返回YES.
我在plist中添加了App寄存器以进行位置更新.
我在AppDelegate中有一个全局位置管理器,startUpdatingLocation在前台和后台运行中都可以正常工作.
[CLLocationManager regionMonitoringAvailable]和[CLLocationManager regionMonitoringEnabled]都返回YES.
我在plist中添加了App寄存器以进行位置更新.
我在AppDelegate中有一个全局位置管理器,startUpdatingLocation在前台和后台运行中都可以正常工作.
然后我有
CLLocationCoordinate2D p = CLLocationCoordinate2DMake(45.488,9.16); CLRegion *region=[[CLRegion alloc] initCircularRegionWithCenter:p radius:100.0 identifier:@"emanuele"]; CLLocationAccuracy acc=200.0; [locationManager startMonitoringForRegion:region desiredAccuracy:acc];
但是当在模拟器上进行测试时,我无法同时获得didEnterRegion和monitoringDidFailForRegion.
我做错了什么或遗失了什么?
非常感谢提前.
解决方法
看起来您的半径只有100米,但您的精确度设置为200米.尝试将精度设置为最佳,并查看是否有改进的结果.
它看起来也不像你的坐垫不够准确到达100米.尝试更准确的更精确的坐标.其他一切看起来都不错.