When you test this code, you need to make sure that you tested it on the device, and not just using iOS Simulator.
In addition, I suggest that you double-check the settings on this device to make sure Location Services on the first settings page says Off .
Mike hay
source share