Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is my CLLocationManager not responding to startMonitoringForRegion?
    primarykey
    data
    text
    <p>At the bottom (in AppDelegate.m) you can see my <code>CLLocationManager</code> delegate methods, none of them get called. I'm using a GPX file, but even if the regions do not get entered or exited, the delegate method <code>didStartMonitoringForRegion</code> should be called.</p> <p><strong>SomeOtherClass.m</strong></p> <pre><code>AppDelegate appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; [appDelegate.locationManager startMonitoringForRegion:regionToMonitor desiredAccuracy:kCLLocationAccuracyNearestTenMeters]; </code></pre> <p><strong>AppDelegate.h</strong></p> <pre><code>@interface AppDelegate : UIResponder &lt;UIApplicationDelegate,CLLocationManagerDelegate&gt; @property (nonatomic, retain) CLLocationManager *locationManager; </code></pre> <p><strong>AppDelegate.m</strong></p> <pre><code>- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { if (locationManager==nil) { locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; } return YES; } -(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { NSLog(@"Did enter region"); } -(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region { NSLog(@"Did exit region"); } -(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error { NSLog(@"Fail"); NSLog(@"%@", [error description]); } -(void)locationManager:(CLLocationManager *)manager didStartMonitoringForRegion:(CLRegion *)region { NSLog(@"Did start monitoring for region: %@", region.identifier); } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
    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