Note that there are some explanatory texts on larger screens.

plurals
  1. POCore Location region monitoring
    primarykey
    data
    text
    <p>Does anyone know any knowledge of using this:</p> <p><code>- (void) startMonitoringForRegion:(CLRegion *)region desiredAccuracy:(CLLocationAccuracy)accuracy</code></p> <p>I am trying to implement it into my project but:</p> <p><code>- (void) locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region</code></p> <p>is never being called?</p> <p>Does anyone have any example code or know why this is happening?</p> <p>My code is as follows. I created a method like this in my own LocationManager class: </p> <pre><code> - (void) locationManagerStartMonitoringRegion:(CLRegion *)region withAccuracy:(CLLocationAccuracy)accuracy { NSLog(@"Start Monitoring"); [locationManager startMonitoringForRegion:region desiredAccuracy:accuracy]; NSLog(@"Monitored Regions: %i", [[locationManager monitoredRegions] count]); } </code></pre> <p>I then call it like this: </p> <pre><code>CLLocationCoordinate2D coordinates = CLLocationCoordinate2DMake(51.116261, -0.853758); CLRegion *grRegion = [[CLRegion alloc] initCircularRegionWithCenter:coordinates radius:150 identifier:[NSString stringWithFormat:@"grRegion%i", value]]; [locationManager locationManagerStartMonitoringRegion:grRegion withAccuracy:kCLLocationAccuracyBest]; </code></pre> <p>I get NSLog's of:</p> <blockquote> <p>2011-01-30 19:52:26.409 TestingLocation[10858:307] Start Monitoring</p> <p>2011-01-30 19:52:27.103 TestingLocation[10858:307] Monitored Regions:</p> </blockquote> <p>But never get an NSLog from:</p> <pre><code> - (void) locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { NSLog(@"Entered Region"); } </code></pre> <p>or</p> <pre><code> - (void) locationManager:(CLLocationManager *)manager monitoringDidFailForRegion:(CLRegion *)region withError:(NSError *)error { NSLog(@"monitoringDidFailForRegion: %@",error); } </code></pre> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload