I've updated my iOS SDK
to version 6. After that I've compiled my app (works fine in iOS 4 & iOS 5
) but now the location services doesn't work. My delegate
isn't receiving any update and the upper location arrow is not appearing... I'm starting the service as the usual way:
[locationManager startUpdatingLocation];
My project is non ARC.
What is happening? This is driving me crazy...
Thanks in advance.
setting CFBundleDisplayName solved the problem for me. Same thing location update was never called, just set the info.plist parameter and it start working.
This is a change in iOS6:
You need to implement locationManager:didUpdateLocations: instead of locationManager:didUpdateToLocation:fromLocation to be notified when the location is updated.
You should also read the documentation about startUpdatingLocation.
Am I being too simplistic here? Under Privacy, Locations looks the same as it did in previous issues.What's all the fuss about?
I've tried everything in plist files, cleans, rebuilds, new targets, configurations, etc, etc, etc. Nothing worked. But FINALLY I've fixed it. I had to create a new Xcode 4.5 project from scratch, reconfigure it, add file by file and framework by framework manually. It seems that my old XCode project had something internally incompatible with last XCode. I write this here because maybe it can save someone's next 10 hours of work.
Make sure you have a CFBundleDisplayName in your project's .plist file. Adding that key fixed it for me.
In my case, I had the location manager under a different class and I was calling this class from the main controller. This was not working and the didUpdateLocations was not called.
The above code does not work. Why? I do not know ....you can easily lose interest when you spend so much time trying to do a thing that is supposed to be simple. iOS is very complicated and unfriendly programming environment. There are many ways to do one thing, only one works, you cannot mix and match without introducing a problem. You have to do everything by the book or you or you get nothing. Not even a hint that you did something wrong ... frustrating ...
Instead when I implemented locationManager:(CLLocationManager *)manager didUpdateLocations: in the main controller everything worked fine