How do I get the current location or GPS coordinates with the Core Location framework?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
first of all you need a class implementing the protocol
CLLocationManagerDelegate. So at least you need to implement the method:After that create an instance of CLLocationManager, set the delegate and start updating the location:
After calling
startUpdatingLocation, your implementation oflocationManager: didUpdateToLocation: fromLocationgets called as soon as a location fix occurs. The parameternewLocationcontains your actual location. BUT the location manager will fix a location as soon as possible, even if your specifed accuracy is not given. For this case you have to check the accuracy of the new location by your own.cheers,
anka