Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><strong>The location manager protocol reference</strong></p> <p><a href="https://developer.apple.com/library/mac/#documentation/CoreLocation/Reference/CLLocationManagerDelegate_Protocol/CLLocationManagerDelegate/CLLocationManagerDelegate.html" rel="nofollow">https://developer.apple.com/library/mac/#documentation/CoreLocation/Reference/CLLocationManagerDelegate_Protocol/CLLocationManagerDelegate/CLLocationManagerDelegate.html</a></p> <p>1.In Appdelegate </p> <pre><code>#import &lt;CoreLocation/CoreLocation.h&gt; </code></pre> <p>In @interface file</p> <pre><code>CLLocationManager *locationManager; @property (nonatomic, retain) CLLocationManager *locationManager; </code></pre> <p>and add protocol <strong>CLLocationManagerDelegate</strong> protocol.</p> <p>2.Impliment these functions in .m.</p> <pre><code>@synthesize locationManager; - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.locationManager = [[[CLLocationManager alloc] init] autorelease]; self.locationManager.delegate = self; self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self.locationManager.distanceFilter = 1.0; [self.locationManager startUpdatingLocation]; } - (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region { // Show an alert or otherwise notify the user } - (void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region { } - (void)locationManager:(CLLocationManager *)manager monitoringDidFailForRegion:(CLRegion *)region withError:(NSError *)error { } </code></pre> <p><strong>Note</strong>:If you want to debug first set current location in simulator At <strong>Debug--->Location--->Custom Location.</strong></p>
 

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