Thursday, 5 September 2013

startMonitoringForRegion invoke didEnterRegion/didExitRegion only for city region. Does It ignore my CLCircularRegion?

startMonitoringForRegion invoke didEnterRegion/didExitRegion only for city
region. Does It ignore my CLCircularRegion?

I have created a CLLocationCoordinate2D variable which is centre of map.
CLLocationCoordinate2D *targetPoint =
[[CLLocation alloc]
initWithLatitude:regionMapView.centerCoordinate.latitude
longitude:regionMapView.centerCoordinate.longitude];
targetRegion = [[CLCircularRegion alloc]
initWithCenter:targetPoint.coordinate
radius:100
identifier:cityLabel.text];
[locationManager startMonitoringForRegion:targetRegion];
However, it looks like the region I start monitor is not work. These
delegate functions
- (void)locationManager:(CLLocationManager *)manager
didEnterRegion:(CLRegion *)region {
[self showAlertWithTitle:@"Entering Region"
Message:region.identifier];
}
- (void)locationManager:(CLLocationManager *)manager
didExitRegion:(CLRegion *)region {
[self showAlertWithTitle:@"Exiting Region"
Message:region.identifier];
}
are invoked only for switching from a city to another city.
My 100 meters radius CLCircular region doesn't works.

No comments:

Post a Comment