Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I had both a map controller object and a location manager object instantiated in my app delegate.</p> <pre><code>mapController = [[[MapController alloc] initWithFrame:CGRectMake(0, 0, 0, 0)] retain]; [self restartLocationManager]; </code></pre> <p>However, the location manager purpose property is not set until the location manager is instantiated in this code:</p> <pre><code>- (void) restartLocationManager { if (locationManager) [locationManager release]; locationManager = [[[CLLocationManager alloc] init] retain]; locationManager.purpose = NSLocalizedString(@"Location Service Purpose", nil); locationManager.distanceFilter = kCLDistanceFilterNone; locationManager.desiredAccuracy = kCLLocationAccuracyHundredMeters; [locationManager startUpdatingLocation]; } </code></pre> <p>So this was a clue that something in the initialization of the map was triggering the first alert. </p> <p>Because I declined to turn location services on in the first alert, the map controller initialized and saw a need to show the alert. The map controller initialization is this (it is part of a singleton, and needs some cleanup in that regard, but ignoring that...):</p> <pre><code>- (id) initWithFrame:(CGRect)aFrame { @synchronized(self) { if (!theMap) { if (!self) self = [super init]; theMap = [[[MKMapView alloc] initWithFrame:aFrame] retain]; theMap.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; theMap.showsUserLocation = YES; theMap.delegate = self; } return self; } </code></pre> <p>Stepping through the code, I saw the second alert show up when the <code>showUserLocation</code> line was executed. I'll have to do a little more testing to narrow it down exactly, but I think I'm on the right track now. </p>
    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