Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The first thought is that you may not want to send startUpdatingLocation to the CLLocationManager until after you've pushed your loading view. Often the first -locationManager:didUpdateToLocation:fromLocation: message will appear instantly with cached GPS data. This only matters if you're acting on every message and not filtering the GPS data as shown in your sample code here. However, this would not cause the situation you've described - it would cause the loading screen to get stuck.</p> <p>I've experienced similarly weird behavior like this in a different situation where I was trying to pop to the root view controller when switching to a different tab and the call wasn't being made in the correct place. I believe the popToRootViewController was being called twice for me. My suspicion is that your loading view is either being pushed twice or popped twice.</p> <p>I recommend implementing -viewWillAppear:, -viewDidAppear:, -viewWillDisappear: and -viewDidDisappear: with minimal logging in your LoadingViewController. </p> <pre><code>- (void)viewWillAppear:(BOOL)animated { NSLog(@"[%@ viewWillAppear:%d]", [self class], animated); [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { NSLog(@"[%@ viewDidAppear:%d]", [self class], animated); [super viewDidAppear:animated]; } - (void)viewWillDisappear:(BOOL)animated { NSLog(@"[%@ viewWillDisappear:%d]", [self class], animated); [super viewWillDisappear:animated]; } - (void)viewDidDisappear:(BOOL)animated { NSLog(@"[%@ viewDidDisappear:%d]", [self class], animated); [super viewDidDisappear:animated]; } </code></pre> <p>Then, run a test on your device to see if they are always being sent to your view controller and how often. You might add some logging to -updateClicked to reveal double-taps.</p> <p>Another thought, while your @synchronized block is a good idea, it will only hold off other threads from executing those statements until the first thread exits the block. I suggest moving the -stopUpdatingLocation message to be the first statement inside that @synchronized block. That way, once you decide to act on some new GPS data you immediately tell CLLocationManager to stop sending new data.</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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